[Beetle ESP32-C3 Review] Part 2: vscode+idf+oled running through
[Copy link]
This post was last edited by lingxin_yuhe on 2022-8-24 10:29
Preface: I have built the VScode+idf development environment. Later, I want to make a small demo of real-time time and weather display. First, I need to debug the display. I have an SSD1306, which should be enough for display, so I use it. The next step is to drive SSD1306.
project is available on GitHub . We modified it to adapt it to our ESP32-C3. Let's take a look at the adaptation process.
- Download open source projects
Go to the project address to download the source code, unzip it to the esp directory after downloading, and install the esp-idf directory, as shown in the figure.
Figure 1
- Adapt to ESP32-C3
Open VSCode and open the ESP32-IDF-OLED-SSD1306 folder. As shown in the figure, we will modify several places to adapt it to ESP32-C3.
Figure 2
- Modify the I2C configuration
Open the edit configuration interface as shown in Figure 2, and modify the I2C pin definition as shown in Figure 3. Because ESP32-C3 has only one I2C, SDA (GPIO8), SCL (GPIO9), and I2C port is 0.
Figure 3
- Modify the flash size
Because the flash size of ESP32-C3 is 4MB, it needs to be modified to 4MB, as shown in Figure 4. Note that you must click the Save button after the modification is completed.
Figure 4
- Compile and download
Click on Figure 2 and select ESP32-C3 as the processor, click on the project file path, select esp32c3, and select the first one, as shown in the figure below.
Click to compile the project. The antivirus needs to be turned off during the compilation process, otherwise the compilation will be very slow, as shown in the figure below. After the compilation is completed, it will prompt that the compilation is successful.
Insert the USB into the computer, set the serial port, and download the flash directly.
- Running Tests
After the download is complete, you need to restart and you will see the following interface.
esp32c3-oled
|