Devices & Components
Arduino Nano
LED (generic)
Resistor 10k ohm
Tactile Switch, SPST-NO
Software & Tools
Arduino IDE
Project description
Code
Code used to control led with Pushbutton
arduino
Please watch video to observe slight changes to that coode to adjust LED behaviour, and also to activate using internal pullup resoistor
1void setup() { 2 pinMode(A0,INPUT); 3 pinMode(9,OUTPUT); 4} 5void loop() { 6 if(digitalRead(A0)==HIGH) 7 digitalWrite(9,HIGH); 8 else 9 digitalWrite(9,LOW); 10} 11
Downloadable files
Pulldown resistor diagram
Pulldown resistor diagram

Pullup Resistor Diagram
Pullup Resistor Diagram

Pulldown resistor diagram
Pulldown resistor diagram

Pullup Resistor Diagram
Pullup Resistor Diagram

Comments
Only logged in users can leave comments