- ESP32 Arduino source library: arduino-esp32
- ESP32 Arduino environment construction instructions: About Arduino ESP32
Other software environment requirements:
1. Install Arduino software
You can get the Windows-side Arduino installation package from the Arduino official website , as follows:
Use the following to install the Arduino environment with .exe
one click
The installation is complete
2. Import the arduino-esp32 library
Import the arduino-esp32 library in Arduino IDE , see "Installing using Arduino IDE"
- Stable version link:
https://espressif.github.io/arduino-esp32/package_esp32_index.json
- Development version link:
https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json
open File —> Preferences
interface
Copy the above link to Additional boards manager URLs
below
Click OK
, the installation process will be printed as follows
3. Add library management
open Tools —> Manage Libraries
interface
4. Select the development board
open Select Board —> Select other board and port
interface
Search for ESP32
the series
Click OK
to jump out of the installation interface
Select Yes
, install immediately, you will enter the following installation process, this process needs to wait for a while
The installation content will be printed in a black box
After the installation is complete, the ESP32 series development board option will be added to Tools —> Board —> esp32
the interface
Many ESP32 test routines will also be added in File —> Examples —> ESP32
the directory .
Next, you can open any routine to test, select the development board model in Tools
the directory , and configure COM
the port
Click the button directly 下载
to complete 工程编译
and固件下载
Finally, you can open Serial Monitor
the interface to view the firmware operation log
The following provides an example test code based on GPIO26 lighting
/*
BlinkRGB
Demonstrates usage of onboard RGB LED on some ESP dev boards.
Calling digitalWrite(RGB_BUILTIN, HIGH) will use hidden RGB driver.
RGBLedWrite demonstrates controll of each channel:
void neopixelWrite(uint8_t pin, uint8_t red_val, uint8_t green_val, uint8_t blue_val)
WARNING: After using digitalWrite to drive RGB LED it will be impossible to drive the same pin
with normal HIGH/LOW level
*/
//#define RGB_BRIGHTNESS 64 // Change white brightness (max 255)
#define RGB_BUILTIN 26
// the setup function runs once when you press reset or power the board
void setup() {
// No need to initialize the RGB LED
Serial.begin(115200);
pinMode(RGB_BUILTIN, OUTPUT);
Serial.printf("GPIO is %d \r\n", RGB_BUILTIN);
}
// the loop function runs over and over again forever
void loop() {
#ifdef RGB_BUILTIN
digitalWrite(RGB_BUILTIN, HIGH);
Serial.printf("Light on \r\n ");
delay(1000);
digitalWrite(RGB_BUILTIN, LOW); // Turn the RGB LED off
Serial.printf("Light off \r\n");
delay(1000);
#endif
}