Light Blinking Arduino Programme
Light Blinking Arduino Programme
Code:
cpp
CopyEdit
// Pin 13 is connected to the onboard LED on most Arduino boards int ledPin = 13; void setup() { // Set the LED pin as an output pinMode(ledPin,
OUTPUT); } void loop() { // Turn the LED on digitalWrite(ledPin, HIGH); delay(1000); // Wait for 1 second (1000 milliseconds) // Turn the LED
off digitalWrite(ledPin, LOW); delay(1000); // Wait for 1 second }
Instructions:
1. Connect the positive (longer leg) of the LED to pin 13 of the Arduino and the negative (shorter leg) to the GND pin through a 220-ohm resistor.
2. Upload the code to your Arduino board using the Arduino IDE.
3. Observe the LED blinking with a 1-second interval.