Sunday, 8 October 2017

Interfacing LED with Arduino

Interfacing Circuit:



Code:

int led=13; //LED CONNECTED TO DIGITAL PIN 13

void setup()
{
  pinMode(led, OUTPUT); // DEFINE LED IS OUTPUT DEVICE
}

void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

No comments:

Post a Comment