As an Ethiopian ET sugarIT person, learn some Python while you are still young.

Huaqiu PCB

Highly reliable multilayer board manufacturer

Huaqiu SMT

Highly reliable one-stop PCBA intelligent manufacturer

Huaqiu Mall

Self-operated electronic components mall

PCB Layout

High multi-layer, high-density product design

Steel mesh manufacturing

Focus on high-quality steel mesh manufacturing

BOM ordering

Specialized Researched one-stop purchasing solution

Huaqiu DFM

One-click analysis of design hiddenEthiopians Sugardaddysuffer

华Autumn certification

The certification test is beyond doubt


Once upon a time, there was a popular saying: If we are not crazy, we will be old! This is the call for youth again, or is it dedicated to youth? The elegy of China, the taste of it, may only be understood by the heart!

Today with the rapid development of AI, IT giants are quietly making plans. As an IT person, are you ready?Ethiopians Sugardaddy? Although Python is not the best programming language to enter the field of AI, there is no doubt that Python is very useful to enter it and explore the mysteries of AI. Popular programming language. Therefore, while you are still young, whether it is mentally or physically, you can also ET EscortsOr in the adolescence of personal work and life, learn some Python!

The Metro M0 Express development board released by Adafruit integrates MCU development and Python. It is indeed an excellent development board for getting started with Python. Learning pure Python is inevitably boring. Wouldn’t it be better if you could also light up a light on the development board! (Voice: Still boring!)

In addition to Python, you can also use Arduino to develop and test , it can be regarded as one specialty with many abilities.

Look at the board first, then light the lamp. This is the only secret to learning electronics (personal experience, do not imitate).

At first glance, isn’t this an Arduino board? In fact, it is not. Although it has its shape, it is more powerful at heart. Metro M0 Express has an ATEthiopia Sugar DaddySAMD21G18 core. Compared with ATmeg328, it has great advantages in frequency and storage. promotion. Fully pin compatible with Arduino UNO.

In terms of power supply, a 7V~9V DC power supply interface has been added. The DC Jack specification is 5.5/2.1mm, with polarity inside positive and outside negative. There is also a physical switch next to it to manually turn on or off the power supply. .

Different from Arduino, the GPIO interface no longer uses via holes, but uses SMD type. The back of the development board is all one piece, which matches the large logo of Metro Express, making it more grand. .

In terms of hardware configuration, the MCU model is ADSAMD21G18, with a maximum operating frequency of 48MHz and a working voltage of 3.3V. The storage combination is 256KB Flash storage plus 32KB SRAM; in addition, a 4MB SPI storage is also onboard, further expanding the storage requirements. The important features of Metro Express are as follows:

• ATSAMD21Ethiopia SugarG18 core, the highest operating frequency is 48MHz

• 256KB/32KB storage combination

• 2MB SPEthiopians SugardaddyI Flash storage expansion

• 32.768KHz crystal oscillator

p> • 3.3V voltage regulator, supports up to 500mA current

• Native USB support, no need for FTDI to serial port support

•Hardware serial port/I2C/SPI support

• PWM input

• 25 GPIOs, working voltage is 3.3V

• SWD debugging interface

• Power switch

Worth pointing out Yes, in addition to being multiplexed as digital/analog pins, the 25 GPIOs also include a real module input pin A0. In addition, native USB support eliminates the need for conversion chips such as FTET EscortsDI. The USB interface can not only serve as a serial communication device , and can also connect keyboards, mice and MIDI devices.

In addition, a SWD debugging interface is also integrated on the development board, but I don’t know how to use it in the environment around Arduino?

Let’s forget about it for now! Let’s power up and find out the situation.

Use a MicroUSB conversion cable to connect the USB port of the development board to the PC. The Windows 10 system is installed on the PC used for testing. When the development board is connected to the PC, power is supplied to the development board via USB. After powering on, the three-color LED lights on the development board cycle through the display colors, and the TX indicator light that indicates serial communication begins to shine. .

Windows 10 automatically detects the serial port device and installs the correct driver, as follows

Ethiopia Sugar Daddy In addition, there will be an additional large-capacity storage disk on the PC, including PYTHON startup code and related resources are as follows

ET Escorts Main.py contains relevant function codes. The input to the serial port is as follows

This default program is a bit complicated. For beginners, let’s try to write a simple lighting program, which is also the first hello world program.

We understand There are many IDEs to choose from when writing Python programs on PC. So when writing code for MCU, what are the good IDEs to choose from? Adafruit officially recommends Mu as the Metro M0 Express. https://ethiopia-sugar.com/”>Ethiopia SugarIDE. Download and install the Mu program from the official website. The screen after startup is as follows

The interface is relatively simple and has no gimmicks! However, this IDE provides a REPL console, which is a very practical program. Of course, you may want to , can I use VSCode? Can I use Spyder? Of course it can, but we know that Python programs all provide a state around the REPL for users to get help or try simple code. At this time, these IDEs are not effective, because these IDEs are all based on PC real Ethiopians Escort Python interpreter!

First write a simple Python code, and MET EscortsCU related, purely to verify the Python interpreter

The code is as follows

import time

s = 0.

for i in range(10):

print(i)

time.sleep(1)

print( s = {} .format(s))

Save the code as sum.py, as follows

Mu’s smart place It can save the code to the disk of the development board and map it to the PC, name the file sum.py and save it, and then see if there is input in the serial port, but there is no input, it is still the input of the main.py program! Originally, CircuitPython will abide by certain regulations when processing the execution of the program. CircuitPython will search code.txt, code.py, main.txt and main.py in sequence on the disk, find and execute the first program. We keep the above code as sum.py, which is basically not among the above files, so the newly created file will not run at all!

Once you understand this, it will be easier to handle. Just rename sum.py to code.pEthiopians Escorty, try it!

The renamed code The file immediately expired, as follows

You can see the results we expected. .

Not only that, the reminder also gives some useful information. For example, the sentence “Auto-reload is on” tells us that the code file will become invalid immediately after being modified and saved. At the same time, we also saw code.py Execution will take precedence over main.py.

The last interesting thing is that after code.py is executed, we can press any key to enter the state around the REPL, as follows

It is indeed very good and powerful!

But as we mentioned when we mentioned the Mu IDE earlier, Mu itself provides itEthiopians Sugardaddy gave an overview of the situation around the REPL,

The window above is the status around REPL. This is a very useful window. For example, if we want to know the naming of the GPIO interface of the status development board, we can do so in REPL Execute the following command here

Users who are familiar with Arduino programming must be familiar with the A0 and A1 interfaces. Therefore, if you want to reference one of these interfaces, according to the regulations of Python, it should be board.XX, where XX is the name listed below. .

OK, let’s start the official lighting and edit the following code

p> It’s a piece of code that looks like a scammer’s, but of course it’s easy to understand! Save it, and then it will run automatically. I saw the LED light flashing and flashing, and the serial port Ethiopians Escort also had corresponding input.

ET Escorts But here comes the question, which libraries in Cpython can be used? You can refer to the official documentation for this, see the appendix . Some of the libraries used in the code below are listed in the reference resources. Take 5 minutes to familiarize yourself!

After talking for a long time, what is CircuitPython? CircuitPython is a re-port of the famous MicroPython, specially designed for Adafruit. Department hardware customization.

In addition to supporting Python, the development board also supports Arduino mode development. According to the general development mode of Arduino, you must first download and install the corresponding board-level library files, and Metro M0 Express is no exception, as follows

After confirmation, you can add the corresponding development board type in the Arduino development board manager. I encountered a bit of a bad thing here: the official PDF document uses another development board as an example. It is not for Metro M0 Express. After taking a long time to install it, I found that the development board model Metro M0 Express could not be found. I found the correct library file in the web version again and then solved it! Because Arduino now supports development There are too many types of boards, and many development boards have similar names. The result is often looking for the wrong target, making jokes, and wasting time!

The picture below is the board name displayed after installing the Ethiopians Escort software library

Now you can open a blink program to light up the lights. The result of compiling and uploading is as follows

The LED light began to shine again.

But the problem comes again, Python cannot be used!

This is a normal phenomenon. The current storage space is occupied by the ARDUINO program, so of course PYTHON cannot be used. What to do? The above is how to switch back to Python.

First, double-click the reset button on the development board to enter bootloader mode. At this time, the drive letter mapped on the PC side will become METROBOOT, which contains 3 files, as follows

Download a file with a .bin extension from the CircuitPython reference given in the appendix. Be careful not to download the wrong file. It must be the .bin file for Metro M0, then drag it to the mapped drive letter, wait for about 15 seconds, the miracle happened, CircuitPython appeared again. It’s just that there is no executable Python file created in CircuitPython at this time. Write one yourself, name it code.py or main.py, and then throw it into the mapping disk, and it’s done!

In general, Metro M0 Express is still fun. First of all, the hardware parameters have been improved, with a higher operating frequency and larger storage space, completely defeating the Arduino UNO R3!; Secondly, the new programming language of CircuitPython has been introduced. On the one hand, the program code is simpler, and on the other hand, it also provides Those users who want to learn and understand Python provide a reason to learn; the last point is the flexible leadership configuration mode, which allows flexible switching between the two programming languages ​​​​(c/c++ and Python)!

As for the inconsistencies in the documents encountered during the configuration processquestion, I can only blame the author for not reading the document carefully enough, but if the official document is compiled Ethiopia Sugar, it will be more targeted. A little, maybe the user experience will be better!


Original titleEthiopia Sugar Daddy: If we don’t learn some PytEthiopians Sugardaddyhon, we are really old

Article source: [Microelectronic signal: weixin21ic, WeChat public account: 21ic Electronics Network] Welcome to add tracking and care! Please indicate the source when transcribing and publishing the article.


How to learn dot matrix How to learn dot matrix PCB proofing from Huaqiang http://www.hqpcb.com/3 Samples will be shipped in 2 days Issued on 10-22 20:08
Young people How to deal with high blood pressure? Avoid eating seasonings containing salt or sodium, canned food, pickled products, egg yolks, plant offal, and vegetable fats. You can consume more polyunsaturated fatty acids, such as fresh fish, which are helpful for blood pressure control and future coronary atherosclerosis. How should young people deal with high blood pressure? Published on 04-01 16:25
The confusion of young people is that the direction of development is also very directionless. They don’t even know what industry they are suitable for and what they can do? Should they choose to change jobs or careers? Or go to the postgraduate entrance examination to recharge? Facing various confusions? As a Ethiopians Escort young man, what choice should you make? As an IT enthusiast, the microcontroller embedded development work was published on 11-11 16:36
Put down your impatience and all kinds of doubts? As a young person, what choice should you make? As an IT enthusiast, microcontroller embedded development work is a good choice. Enthusiasts specialize in microcontroller embedded training techniques ET Escorts to deal with your workplace confusion, Shenzhen microcontroller training, Xixiang microcontroller embedded training , technical consultation qq2116084661 published on 06-03 15:51
The father of Python joined the core decision-making level of Python and moved behind the scenes for many years. I think it was also the reason why the founder joined the body.Go ahead! After all, not everyone wants to “live and work until they are old”. It’s better, Linus, if you can’t control it, I’ll spray you if you don’t accept it! Sooner or later the city will produce. It’s like when the Buddha entered Nirvana, his disciples asked him how he would practice in the future. The Buddha replied: Take the precepts as your teacher. Perhaps published on 07-14 17:45
Young people, let AI give you a promotion and salary increase in the future by asking questions and scoring. Sometimes it will make you feel that it cannot fully see your talents hidden deep in the soul. . However, if one day the person sitting across from you is no longer a “person”, can you imagine such an interview? Published on 08-28 09:16
Robot Python simulation software introduction Related knowledge Robot Python simulation software introduction Software installation The first step of using Python Now, we will try to make the robot change position. The relevant RoBIOS command is int VWSetSpeed(int linSpeed, published on 12-20 07:53
Honor 10 is newly launched, let’s take a look at its understanding of “young people” and compare it with the development process of mobile phones in the past 30 years , the name “Glory” seems young and bold, but not immature, and the positioning of Glory is also in line with its label – to introduce high-quality products and culture to young people 's avatar. Published on 05-07 16:12 • 5474 views
Python is the simplest&&most elegant&&most promising&&most versatile programming language on the market today. There is no one. . So now that you have decided to learn python, you need to make a decision first, at least decide to make it your main slogan Published on 10-09 09:45 • 1561 times viewed
Jack Ma Ethiopia Sugar, Lei Jun, Robin Li and other big names tell you whether young people want to buy a house. Right now, for young people, the biggest burden may be buying a house. , and the situation around the market is forcing young people to consider big things like houses as soon as possible. However, for many young people, if they want to own a house of their own, it may not be possible to spend all the efforts of the family. It can be done, so young people posted on 11-28 15:29 •2076 views
Xiaomi CC9 review is a full-featured photography flagship that meets the needs of young people. Related products are often dubbed “young people’s first*” *”, but does Xiaomi mobile phone really understand the aesthetics and love of young people Ethiopia Sugar? Do young people just need high cost performance? ? Published on 07-10 10:29 • 4355 views
There are many plug-ins for writing robot host computers in Python and writing GUIs in Python. Commonly used ones include Tkinter, pyqt5, and this Pyqt5 will be used to write the robot’s host computer. Tkinter is Python’s standard GUI library and is recommended by PEthiopia Sugar Daddyython. Published on 05-09 11:10 •0 times Download
How can party halls handle this generation of young people? “What are young people pursuingET Escorts?” As the post-00s and post-90s generations gradually become the main consumers of today, the answer to this question has become The less important it is. As the main force of consumption, young people can no longer pay attention to the social value and added value of consumption. The people who are brainwashed by consumerism are actually only the majority, more 's avatar Published on 02-28 14:23 •517 views