Esp32-Stick Development Boards(POE-A, POE-P, ETH) Blink
by GrunclMichal in Circuits > Arduino
278 Views, 0 Favorites, 0 Comments
Esp32-Stick Development Boards(POE-A, POE-P, ETH) Blink
Hello
This is a simple tutorial on how to make a blink program with Esp32-Stick development boards (POE-A, POE-E, ETH)
Supplies
Connecting
Esp32-Stick development boards have one user LED build inside of them and connected to GPIO2 so we don't have to connect external LED. Thanks to that all that we're left with is to connect USB-C to its dedicated port on one side and on the other to PC and we're done :)
Code
We'll be using VSCode with PlatformIO extension installed.
So, after installing PlatformIO click at a "Bee icon" and then select "PIO Home>Open"
Click on "New Project" give your project a name, select board "Adafruit ESP32 Feather" and hit Finish
After that open file "platformio.ini" and check if all info is same as here:
[env:featheresp32]
platform = espressif32@2.0.0
board = esp32dev
framework = arduino
monitor_speed = 115200
If not, rewrite anything that is missing or is different
Now for the main code.
You will find it in "src>main.cpp"
(Everything marked with "//" or written between "/* */" is comment. That means it's not a code, but a text written to help you understand it better. Try to read it and see, if you understand what's going on)
//adds Arduino library
#include <Arduino.h>
//defines LED pin
#define LED_PIN 2
/*
* this is first called methode that setups everything
*/
void setup() {
//setup pin 2 to be a LED pin
pinMode(LED_PIN,OUTPUT);
}
/*
* this methode is called as second and will loop forever
*/
void loop() {
//turns LED on waits than turns it off and waits again (blinks LED)
digitalWrite(LED_PIN,HIGH);
delay(1000); //number in brackets is waiting time in milliseconds
digitalWrite(LED_PIN,LOW);
delay(1000); //number in brackets is waiting time in milliseconds
}
Now just save and hit Ctrl+Alt+u to upload the project to your ESP32
And You're done. Great Job :D