[Digi-Key Follow me Issue 2] Newbie Task: Environment Construction
[Copy link]
This is my first time participating in flow me, and I hope to keep up with the pace of the main group. This time, flow me plans to use circuit python development, so before getting the development board for development, it is necessary to prepare and build the software and hardware development environment.
1. Hardware preparation
First, the hardware. According to the official tutorial, enter the circuit python download page corresponding to the board through the following link. The current version has been updated to 8.2.4
https://circuitpython.org/board/adafruit_feather_esp32s3_tft/
You can also select the corresponding language, including Chinese. You can download it as needed.
After the download is complete, you can connect the board to the computer using a type-c cable, and then double-click the Rst button on the board in the figure below twice. The time interval between double-clicking should not be too short. It is expected that the interval between the two presses is about 1S.
At this time, the onboard RGB and other components remain green, and the display screen displays the following content, prompting you to copy the uf2 file to enter.
A disk slot appears on the computer. Open it to see the current file list contained in it. At this time, the downloaded UF2 file is copied in.
After copying the file, the onboard RGB and other lights go out, and the display content becomes as shown below. It can also be seen that there is a line of Hello World in the display content.
And the above disk will disappear, and a new disk called CIRCUITPY will appear soon.
Open it and you can see the file list of the new disk. The code.py is the python file code for subsequent development. You only need to edit the written code above. All the library files needed are placed in the lib folder.
Open the code in code.py. The content is a simple function of printing a hello world. That is, Hello World displayed in the LCD above
At this point, the hardware environment of the development board is ready.
2. Software Preparation
The next step is to install the officially recommended code editor Mu.
Mu is a simple code editor written in Python with a built-in serial console, which is convenient for printing out debugging information! Mu can be downloaded from the following link:
https://codewith.mu/
Then install it according to the normal software installation routine.
After the installation is complete, open it and you will be prompted to select a mode. Just select CircuitPython. Of course, you can change it later.
Then the interface is officially opened.
At this point, the development environment has been set up and you can start your development journey.
3. Code running
Next, we use a simple code to test whether the hardware and software environment are set up properly.
First copy the following code into the editor.
Then click Save and choose to save it in the code.py file on the CIRCUITPY disk.
After clicking Save, the hardware will automatically reset and execute the new code after restarting.
After restarting, the LED on the board will flip on and off every 500ms, and the printed Hello World will disappear because the new code has no print content, indicating that the software and hardware environment has been successfully built!
Next, let's try to change the code, that is, insert a print content: Hello CuicuitPython
After clicking Save, you can see the printed content on the board.
In addition, you can click the serial port button to open the print serial port
At this point you can see the Hello CuicuitPython content printed in the serial port.
It should be noted that the device, that is, the board, should not be manually unplugged easily, and the system needs to be safely deleted. In addition, do not press the reset button on the board easily, especially when saving code, otherwise it may cause code loss.
Now you are all set!
|