Clothes With Lights



Have you ever felt that you might get hit by a car when you are running, well here are the clothes that allow you to run while having lights at the back of the shirt.
Supplies
- 8 led lights
- 12 Jumper wires
- Variable resistor
Making the Circuit

Connect the 8 jumper wires to the PWN of the Arduino Board
Then add the LED to the jumper wires, following the resistors
Then add the variable resistor with jumper wires to the power and the Analog.
The Coding

int ledNum = 8; // define the number of the LEDs
int ledPin[] = {2, 3, 4, 5, 6, 7, 8, 9}; // create array for LED pins int delayTime; // define a variable for the value of delay int potPin = A0; // define the potentiometer pin
void setup() { for (int x = 0; x < ledNum; x++) { // setting all LEDs as OUTPUT pinMode(ledPin[x], OUTPUT); } }
void loop() { for (int i = 0; i < 8; i++) { delayTime = analogRead(potPin); //getting the time delay from the potentiometer digitalWrite(ledPin[i], HIGH); //turn on LEDs delay(delayTime); //time inverval digitalWrite(ledPin[i], LOW); //turn off LEDs } for (int i = 7; i >= 0; i--) { delayTime = analogRead(potPin); //getting the time delay from the potentiometer digitalWrite(ledPin[i], HIGH); //turn on LEDs delay(delayTime); //time interval digitalWrite(ledPin[i], LOW); //turn off leds } }