Difference between revisions of "ESP32: Blink"

From OnnoWiki
Jump to: navigation, search
(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...")
 
(No difference)

Latest revision as of 08:45, 6 October 2019

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