This is a very simple project. All the following schemes are made with fritzing
Required materials:
1. Arduino board
2. 220 ohm resistor
3. 1 LED
4. some wires
Here is the circuital scheme

you need to wire the LED cathode with the resistor and GND.
The LED anode should be wired with any of the digital pins of the Arduino Board (see the image)

Now you must write the code for Arduino:

int switchState=0;
void setup(){
pinMode(3,OUTPUT);
}
void loop(){
if (switchState==LOW){
digitalWrite(3,HIGH);
switchState=HIGH;
}
else{
digitalWrite(3,LOW);
switchState=LOW;
}
delay(120);
}


Refresh