Browse Source

Initial commit for LED in GIO2

master
commit
4e1857a879
2 changed files with 30 additions and 0 deletions
  1. +3
    -0
      Readme.md
  2. +27
    -0
      blinking-led.ino

+ 3
- 0
Readme.md View File

@ -0,0 +1,3 @@
# Readme
for ESP32-S led blinking and serial communication

+ 27
- 0
blinking-led.ino View File

@ -0,0 +1,27 @@
/*
ESP 32 Blink
Turns on an LED on for one second, then off for one second, repeatedly.
The ESP32 has an internal blue LED at D2 (GPIO 02)
*/
// int LED_BUILTIN = 02; // this var is defined in pins_arduino.h for DOIT ESP32 DEVKIT V1
void setup()
{
// this code run only once:
pinMode(LED_BUILTIN, OUTPUT);
//serial monitor setup
Serial.begin(115200);
}
void loop()
{
Serial.print("Hello");
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(250); // wait for 0.250 seconds
Serial.print(" World!!\n");
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(250); // wait for 0.250 seconds
}

Loading…
Cancel
Save