commit 2b98670f53d5694f806aca2f7b149b6f8f9ce4da Author: Gerardo Marx Date: Tue Jul 19 21:08:27 2022 -0500 LED and Serial diff --git a/blinking-serial.ino b/blinking-serial.ino new file mode 100644 index 0000000..d7d9eac --- /dev/null +++ b/blinking-serial.ino @@ -0,0 +1,30 @@ +/* + * + * Example code for ESP32-S: + * The code blinks the onboard LED (at D2 in GPIO 02) every 0.500 seconds. + * The code also prints by serial communcation the word "Hello" during the + * ON stage of the LED, and then prints "World" during the OFF. + * Gerardo Marx 19/Jul/2022 + */ + +// this variable is defined in pins_arduino.h for DOIT ESP32 DEVKIT V1 +// int LED_BUILTIN = 02; +int LED_ONBOARD = 02; + +void setup() { + // put your setup code here, to run once: + pinMode(LED_BUILTIN, OUTPUT); + //serial monitor setup + Serial.begin(115200); +} + +void loop() { + // put your main code here, to run repeatedly: + Serial.print("ON"); + digitalWrite(LED_BUILTIN, HIGH); + delay(500); + // after delay + Serial.print(" - OFF\n"); + digitalWrite(LED_BUILTIN, LOW); + delay(500); +}