ESP32: Blink

From OnnoWiki
Jump to navigation Jump to search

Blink Onboard LED (Warna Biru) di pin 2


/***
 * LED Blinking
 * Code Written by TechMartian
 */

const int ledPin = 2;

void setup() {
  // setup pin 2 as a digital output pin
  pinMode (ledPin, OUTPUT);
}

void loop() {
  digitalWrite (ledPin, HIGH);  // turn on the LED
  delay(1000); // wait for half a second or 500 milliseconds
  digitalWrite (ledPin, LOW); // turn off the LED
  delay(1000); // wait for half a second or 500 milliseconds
}



Pranala Menarik