ESP32: Blink

From OnnoWiki
Revision as of 08:45, 6 October 2019 by Onnowpurbo (talk | contribs) (Created page with "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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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