Simple LED Test
![thumbnail_PXL_20210510_015556746.jpg](/proxy/?url=https://content.instructables.com/FJL/LM84/KOH6R5L6/FJLLM84KOH6R5L6.jpg&filename=thumbnail_PXL_20210510_015556746.jpg)
at the start i want to make this project just like this, but the code make me give up, so I make it more simple as i can.
Step 1 - the Things You Need
![thumbnail_PXL_20210510_015556746.jpg](/proxy/?url=https://content.instructables.com/F1D/X5UP/KOH6R5L5/F1DX5UPKOH6R5L5.jpg&filename=thumbnail_PXL_20210510_015556746.jpg)
this is the things you need
LED 10
Bread 1
USB cables 1
Buttons 1
Wire 14
Resistor 2
How It Looks Like
![图片1.png](/proxy/?url=https://content.instructables.com/FDA/F4Z5/KOIM7J31/FDAF4Z5KOIM7J31.png&filename=图片1.png)
put them like the picture up there
Code
this is the code I used:
const int buttonPin = 13; int buttonState; void setup() { // put your setup code here, to run once: for (int i=1; i<14 ; i++){ pinMode(i, OUTPUT); pinMode(buttonPin, INPUT); Serial.begin(9600); }} void loop() { // put your main code here, to run repeatedly: buttonState = digitalRead(buttonPin); for (int i=1; i<14; i++){ digitalWrite(i,HIGH); digitalWrite(i-1,LOW); delay(500); if(buttonState==HIGH && i==6){ Serial.println("You Win"); } }}
Done
![thumbnail_PXL_20210426_024440993.jpg](/proxy/?url=https://content.instructables.com/FCM/VIQW/KOH6R2V9/FCMVIQWKOH6R2V9.jpg&filename=thumbnail_PXL_20210426_024440993.jpg)
this is the project I made at start, if you think mine one is to easy you can try this one.