On Macbook Pro 2016 (Mac OS Catalina), Board is ESP32 Pico Kit
- Download Arduino IDE, I used 1.8.16
- Install CP210x VCP Mac OSX Driver
- It will ask you to allow the driver in
Security & Privacy
- It will ask you to allow the driver in
- Even before restarting I had the
/dev/cu.SLAB_USBtoUART
folder. I ended up restarting though. - Open Arduino IDE
Arduino
->Preferences
->Additional Board Manager URLs
, set it tohttps://dl.espressif.com/dl/package_esp32_index.json
Tools
->Board
->Boards Manager
, search forESP32
and click Install (I installed version 1.0.6)-
Tools
->Board
->ESP32 Arduino
->ESP32 Pico Kit
, also select the appropriateUpload Speed
(115200) andPort
(/dev/cu.SLAB_USBtoUART
) -
Test a hello world program
void setup() { Serial.begin(115200); } void loop() { Serial.println("Hello World"); delay(2000); }
- Click on the top second from left icon (right arrow) to upload to ESP32. The black screen below will show how many percent has been written.
- (This took me awhile to figure out) To see the “Hello World”, click on the top right magnifier icon, or
Tools
->Serial Monitor
, select the Baud Rate to 115200.
Using multiple files
Arduino Sketch is a folder, by default saved in ~/Documents/Arduino/sketch_<date>
. (I’m not really sure how it knows which is the main file, maybe by the setup()
and loop()
name)
We can create a function in another file in the same folder, with extension name .ino
. Then write the function definition at the top of where we have the setup()
and loop()
file. It will automatically compile the file in the same folder and find the function definition.
Editing the files on Emacs will not automatically update the opened files in the IDE, but if we close the window and open it with File
-> Sketchbook
, it will automatically open all files inside the sketch folder.
- [ref]
Next thing to learn
- Creating web server
- ESP32 with getty, TCP/IP