Clothes With Lights

by HighestInTheRoom in Circuits > Arduino

144 Views, 0 Favorites, 0 Comments

Clothes With Lights

c000036_featured_1.jpg
5mm_Red_LED.jpg
download.jpeg

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

3333.png

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

343434.png

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 } }