3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Light for life: Glowing button cycling jacket

Step 8More on connecting the bits and pieces

More on connecting the bits and pieces
To make it easier(or more difficult), I have soldiered all the electronics, the Arduino and its 5v battery, to a copper circuit-board. The circuit-board has a connector soldiered to it. The opposite connector is placed on the jacket, with each thread connected on a seperate pin. The connector is a 34-pin floppy connector I found in an old computer, and is perfect for my project.

It is also possible to sew the Arduino Lilypad and its batterypack directly to jacket. The board should be waterproof, are we to believe the creator Leah Buechley. Check out her webpage for more info.

All the ground(-) theads are put together. Remember where you place the - on the connector, as it has to be placed at the same place on Arduino board. As the Arduino Lilypad only has 14 seperate programmable connections, I have connected the light on the front of the jacket to the + on the battery. The 12 light and the 2 pushbuttons are put on the programmable connections.

On the programming part, I have basically borrowed Leah Buechley's code for her cycling-jacket, and given some more fancy light sequences, as I am very novice in Arduino programming. At the bottom of this page i have pasted in my code. Check out Leah's homepage for more detailed info on how to connect the electronic components together, particularly her jacket!

To insulate the conductive thread is advisable. This helps the threads touching eachother. Paint all the threads with puffy textile paint.

int BL1 = 10;
int BL2 = 9;
int BL3 = 8;
int TL1 = 6;
int TL2 = 5;
int TL3 = 4;

int BR1 = 11;
int BR2 = 12;
int BR3 = 13;
int TR3 = 3;
int TR2 = 2;
int TR1 = 1;

int leftSwitch = 7;
int rightSwitch = 0;

int x, y;
int mode = 0;
int DAY = 0;
int NIGHT = 1;

int d;

void setup() // run once, when the sketch starts
{
d = 100;

pinMode(BL1, OUTPUT);
pinMode(BL2, OUTPUT);
pinMode(BL3, OUTPUT);
pinMode(TL1, OUTPUT);
pinMode(TL2, OUTPUT);
pinMode(TL3, OUTPUT);

pinMode(leftSwitch, INPUT);
digitalWrite(leftSwitch, HIGH);
pinMode(rightSwitch, INPUT);
digitalWrite(rightSwitch, HIGH);

pinMode(TR1, OUTPUT);
pinMode(TR2, OUTPUT);
pinMode(TR3, OUTPUT);
pinMode(BR1, OUTPUT);
pinMode(BR2, OUTPUT);
pinMode(BR3, OUTPUT);

}

void loop() // run over and over again
{
checkLeft();
checkRight();
if (mode == NIGHT)
night();
else
day();
}

void checkLeft()
{
if (digitalRead(leftSwitch) == LOW)
{

while (digitalRead(leftSwitch) == LOW)
{
if (digitalRead(rightSwitch) == LOW)
{
while (digitalRead(rightSwitch) == LOW | digitalRead(leftSwitch) == LOW);
mode = 1-mode;

return;
}
}
leftTurn();
}
}

void checkRight()
{
if (digitalRead(rightSwitch) == LOW)
{

while (digitalRead(rightSwitch) == LOW)
{
if (digitalRead(leftSwitch) == LOW)
{
while (digitalRead(leftSwitch) == LOW | digitalRead(rightSwitch) == LOW);
mode = 1-mode;

return;
}
}
rightTurn();
}
}

void leftTurn()
{
for (x=0;x<10;x++)
{
digitalWrite(TL1, HIGH);
digitalWrite(BL1, LOW);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(leftSwitch) == LOW)
{
while (digitalRead(leftSwitch) == LOW);
digitalWrite(TL1, LOW);
digitalWrite(BL1, LOW);
return;
}
}
digitalWrite(TL1, LOW);
digitalWrite(BL1, HIGH);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(leftSwitch) == LOW)
{
while (digitalRead(leftSwitch) == LOW);
digitalWrite(TL1, LOW);
digitalWrite(BL1, LOW);
return;
}
}
digitalWrite(BL1, LOW);
}
}

void rightTurn()
{
for (x=0;x<10;x++)
{
digitalWrite(TR1, HIGH);
delay(d);
digitalWrite(TR2, HIGH);
delay(d);
digitalWrite(TR3, HIGH);
delay(d);
digitalWrite(BR1, LOW);
delay(50);
digitalWrite(BR2, LOW);
delay(50);
digitalWrite(BR3, LOW);
delay(50);
digitalWrite(TL1, LOW);
digitalWrite(BL1, LOW);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(rightSwitch) == LOW)
{
while (digitalRead(rightSwitch) == LOW);
digitalWrite(TR1, LOW);
delay(d);
digitalWrite(TR2, LOW);
delay(d);
digitalWrite(TR3, LOW);
delay(d);
digitalWrite(BR1, LOW);
delay(d);
digitalWrite(BR2, LOW);
delay(d);
digitalWrite(BR3, LOW);
delay(d);
return;
}
}
digitalWrite(TR1, LOW);
delay(d);
digitalWrite(TR2, LOW);
delay(d);
digitalWrite(TR3, LOW);
delay(d);
digitalWrite(BR1, HIGH);
delay(d);
digitalWrite(BR2, HIGH);
delay(d);
digitalWrite(BR3, HIGH);
delay(d);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(rightSwitch) == LOW)
{
while (digitalRead(rightSwitch) == LOW);
digitalWrite(TR1, LOW);
delay(d);
digitalWrite(TR2, LOW);
delay(d);
digitalWrite(TR3, LOW);
delay(d);
digitalWrite(BR1, LOW);
delay(d);
digitalWrite(BR2, LOW);
delay(d);
digitalWrite(BR3, LOW);
delay(d);
return;
}
}
//digitalWrite(BR1, LOW);
digitalWrite(TR1, LOW);
digitalWrite(TR2, LOW);
digitalWrite(TR3, LOW);
digitalWrite(BR1, LOW);
digitalWrite(BR2, LOW);
digitalWrite(BR3, LOW);
}
}

void night()
{

digitalWrite(TR1, HIGH);
digitalWrite(TR2, HIGH);
digitalWrite(TR3, HIGH);
digitalWrite(BR1, HIGH);
digitalWrite(BR2, HIGH);
digitalWrite(BR3, HIGH);
digitalWrite(TL1, HIGH);
digitalWrite(TL2, HIGH);
digitalWrite(TL3, HIGH);
digitalWrite(BL1, HIGH);
digitalWrite(BL2, HIGH);
digitalWrite(BL3, HIGH);

}

void day()
{

digitalWrite(TL1, HIGH);
digitalWrite(TR1, HIGH);

digitalWrite(BR1, HIGH);
digitalWrite(BL1, HIGH);
}
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
16
Followers
1
Author:kempton