Last active
March 29, 2023 14:29
-
-
Save alphaville/fc0e07dee0a79cd8d68871a832cf98f1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Arduino.h> | |
/** | |
* Choose the GPIO port | |
* Wiring: | |
* ESP32-GND to LED- | |
* ESP-G2 to LED+ | |
*/ | |
#define LED 2 | |
/** | |
* Setup serial; Baud rate: 115200 | |
*/ | |
void setup_serial() | |
{ | |
Serial.begin(115200); | |
while (!Serial) | |
/* wait! */; | |
} | |
void setup() | |
{ | |
setup_serial(); // setup serial port | |
pinMode(LED, OUTPUT); // setup LED | |
} | |
void loop() | |
{ | |
delay(500); // wait for 500ms | |
digitalWrite(LED, HIGH); // turn LED on | |
Serial.println("LED is ON"); // send message over serial | |
delay(500); // wait for 500ms | |
digitalWrite(LED, LOW); // turn LED off | |
Serial.println("LED is OFF"); // send message over serial | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment