Home > other >  The LED flashing
The LED flashing

Time:10-03

The hardware required

Arduino or Genuino development board

- LED

Resistance - 220


Circuit connection

Set up circuit, connect one end of the resistance to the Arduino 13 pin, will be LED long legs (anode pin, known as anode) at the end of the link to the other end of the resistance, short legs will LED (negative pins, known as the cathode) connect to GND Arduino,
The code
/*
Blink
Turns on an LED on for one second and then off for one second, repeatedly.

Most Arduinos have an on - board, LED you can control. On the Uno and
Leonardo, it is attached to a digital pin 13. If you 'r e unsure
Pin the on - board, LED is connected to on your Arduino model, check
The documentation at http://www.arduino.cc

This example code is in the public domain.

Modified 8 May 2014
By Scott Fitzgerald
*/


//the setup function runs once the when you press the reset or power on the board,
Void setup () {
//initialize digital pin 13 as an output.
PinMode (13, the OUTPUT);
}

//the loop function runs over and over again forever
Void loop () {
DigitalWrite (13, HIGH);//turn the LED on (HIGH is the voltage level)
Delay (1000);//wait for a second
DigitalWrite (13, LOW);//turn the LED off by making the voltage LOW,
Delay (1000);//wait for a second
}

CodePudding user response:

Want to say? Lights flashing, and then?
  • Related