Arduino IDE Settings for ESP32 MCU
Follow the steps below to set up the ESP32 Wi-Fi Kit development environment.
Next
Install the software needed to write a program in Leafony.What to prepare
- ESP32 Wi-Fi Kit
- USB cable
- PC (Windows, Mac OS X or Linux)
Installing Arduino IDE
For instructions on how to install the Arduino IDE, please see here.
Next
Let’s write a program in Leafony and make it work!Connecting to PC
Connect to your PC with a USB cable.
Configuration of the microcontroller board
To use the ESP32 MCU leaf with the Arduino IDE, you need to install Arduino core for the ESP32.
- Open the
File → Preferences
in the Arduino IDE and enter the following URL in theAdditional Board Manager URL:
field.
https://dl.espressif.com/dl/package_esp32_index.json
- Select
Tools -> Board -> Board Manager
, search foresp32 by Espressif Systems
and press the Install button.
- Choose
Tools → Board → ESP32 Dev Module
to get your ESP32 MCU working.
Checking the operation of the microcontroller board
Let’s write a Sample App and get the ESP32 Wi-Fi Kit running.
- Launch the Arduino.
- Paste the following sample code into your code editor.
//*****************************
// ボタン入力の状態をシリアルモニタに表示するサンプル
//*****************************
int pushButton = 0;
void setup() {
Serial.begin(115200);
pinMode(pushButton, INPUT);
}
void loop() {
int buttonState = digitalRead(pushButton);
Serial.println(buttonState);
delay(1);
}
- Select the COM port to which the ESP32 leaf is connected.
- Push the
write to microcomputer board
button to write a sketch. - Press and hold the
Boot mode switch
on the ESP32 leaf when the following message appears during the writing process.
- Open the serial monitor and set the communication speed to
115200bps
. - Press the
Boot mode switch (IO0)
and see if the input state of the switch changes.
Specifying pins for a sketch
**Pin should be specified by Port, not Name.**
制限事項
※1:Output cannot be set ※2:①For UART1, the pin number is set to RX=26 and TX=25. For UART0 and UART2, the pin number is not specified.
HardwareSerial Serial1(1); // UART1 (RX=9, TX=10)
void setup() {
Serial1.begin(9600, SERIAL_8N1, 26, 25); // ピンを変更 (RX=26, TX=25)
}
②Cannot be used as analog input if WiFi.h is included
※3: Pull-up prohibited because it is used for bootstrapping
Installing Libraries
To use some of the leaves, you will need to install additional libraries.
Here to install all libraries in advance.
When in doubt.
If it doesn’t work, go to “If it doesn’t work…” to find a solution.