A version of this tutorial is also on my website.
Remove these ads by
Signing UpStep 1: Supplies
Get your supplies. You need:
-- LilyPad Arduino main board
-- FTDI connector
-- mini USB cable
-- LilyPad power supply
-- 16 LilyPad LEDs (note: these aren't available from SparkFun yet, but will be soon)
-- 2 push button switches
-- a spool of 4-ply conductive thread
-- a digital multimeter with a beeping continuity tester. This is the one I have.
-- a garment or a piece of fabric to work on
-- a needle or two, a fabric marker or piece of chalk, puffy fabric paint, a bottle of fabric glue, and a ruler
(Available at your local fabric shop or Joann Stores.)
-- a pair of scissors
-- double sided tape (optional)
-- a sewing machine (optional)
disclosure: I designed the LilyPad, so I'll make some $ if you buy one.











































Visit Our Store »
Go Pro Today »




Have you thought of using Bluetooth to remotely operate the switches?
We had a guy bring something like that to our Portland chapter of DorkbotPDX meeting. He also made an LED bike polo scoreboard.
I didn't even know there WAS such a thing as bike polo!
Find another unseen concepts with Arduino based electronics Projects
Can anyone tell me what arduino software was used to program the LilyPad Arduino main board?can i use any software? or does it have a specific software designed for lilypad arduino only? is it possible to put it in a hat? or is ther a problem considering the short length of the conductive thread to be used?
I'm hoping for a reply because I'm using this as my project to be passed about a month from now. Thank you.
if anyone would like to share their knowledge.or can answer this questions pls contact me at rafbeb1905@yahoo.com
Can anyone tell me what arduino software was used to program the LilyPad Arduino main board?can i use any software? or does it have a specific software designed for lilypad arduino only? is it possible to put it in a hat? or is ther a problem considering the short length of the conductive thread to be used?
I'm hoping for a reply because I'm using this as my project to be passed about a month from now. Thank you.
http://web.media.mit.edu/~leah/LilyPad/build/turn_signal_jacket.html
and the code:
http://web.media.mit.edu/~leah/LilyPad/build/turn_signal_code.txt
THANKS
http://www.floatingpath.com/2012/02/18/nano-tech-waterproof/
This Never Wet superhyrophobic stuff works great with clothing.
Hope that the product reaches retail soon.
I tested resistance, all was fine, so I went into the code and first changed left to right signals.
Once I was sure I had not messed up with the sewing, I modified the loop code so that both blink when testing, helping me make sure that connections are correct.
I wanted to share it here, in case someone else is testing it and wants both signals to flash:
int ledPin = 13; // the LED on the LilyPad
int leftSignal = 9; // my left turn signal is attached to petal 9
int rightSignal = 11; // my right turn signal is attached to petal 11
int signalLow = 10; // the - sides of my signals are attached to petal 10
void setup()
{
pinMode(ledPin, OUTPUT); // sets the ledPin to be an output
pinMode(leftSignal, OUTPUT); // sets the leftSignal petal to be an output
pinMode(rightSignal, OUTPUT); // sets the rightSignal petal to be an output
pinMode(signalLow, OUTPUT); // sets the signalLow petal to be an output
digitalWrite(signalLow, LOW); // sets the signalLOW petal to LOW (-)
}
void loop() // run over and over again
{
delay(1000); //wait for 1 second
digitalWrite(rightSignal, HIGH); // turn the right signal on
delay(1000); // wait for 1 second
digitalWrite(rightSignal, LOW); // turn the right signal off
delay(1000); // wait for 1 second
digitalWrite(leftSignal, HIGH); // turn the left signal on
delay(1000); // wait for 1 second
digitalWrite(leftSignal, LOW); // turn the left signal off
delay(1000); // wait for 1 second
}
START CODE:
int boardLED = 13;
int leftSignal = 9;
int rightSignal = 11;
int signalLow = 10;
int rightLow = 4;
int leftSwitch = 6;
int rightSwitch = 12;
int leftLED = 5;
int rightLED = 3;
int x, y;
int mode = 0;
int DAY = 0;
int NIGHT = 1;
void setup() // run once, when the sketch starts
{
pinMode(boardLED, OUTPUT);
pinMode(leftSignal, OUTPUT);
pinMode(rightSignal, OUTPUT);
pinMode(signalLow, OUTPUT);
pinMode(rightLow, OUTPUT);
pinMode(leftSwitch, INPUT);
digitalWrite(leftSwitch, HIGH);
pinMode(rightSwitch, INPUT);
digitalWrite(rightSwitch, HIGH);
pinMode(leftLED, OUTPUT);
pinMode(rightLED, OUTPUT);
digitalWrite(boardLED, HIGH);
digitalWrite(signalLow, LOW);
digitalWrite(rightLow, LOW);
}
void loop() // run over and over again
{
checkLeft();
checkRight();
if (mode == NIGHT)
night();
else
day();
}
void checkLeft()
{
if (digitalRead(leftSwitch) == LOW)
{
digitalWrite(boardLED, LOW);
while (digitalRead(leftSwitch) == LOW)
{
if (digitalRead(rightSwitch) == LOW)
{
while (digitalRead(rightSwitch) == LOW | digitalRead(leftSwitch) == LOW);
mode = 1-mode;
digitalWrite(boardLED, HIGH);
return;
}
}
leftTurn();
}
}
void checkRight()
{
if (digitalRead(rightSwitch) == LOW)
{
digitalWrite(boardLED, LOW);
while (digitalRead(rightSwitch) == LOW)
{
if (digitalRead(leftSwitch) == LOW)
{
while (digitalRead(leftSwitch) == LOW | digitalRead(rightSwitch) == LOW);
mode = 1-mode;
digitalWrite(boardLED, HIGH);
return;
}
}
rightTurn();
}
}
void leftTurn()
{
for (x=0;x<10;x++)
{
digitalWrite(leftSignal, HIGH);
digitalWrite(leftLED, LOW);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(leftSwitch) == LOW)
{
while (digitalRead(leftSwitch) == LOW);
digitalWrite(leftSignal, LOW);
digitalWrite(leftLED, LOW);
return;
}
}
digitalWrite(leftSignal, LOW);
digitalWrite(leftLED, HIGH);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(leftSwitch) == LOW)
{
while (digitalRead(leftSwitch) == LOW);
digitalWrite(leftSignal, LOW);
digitalWrite(leftLED, LOW);
return;
}
}
digitalWrite(leftLED, LOW);
}
}
void rightTurn()
{
for (x=0;x<10;x++)
{
digitalWrite(rightSignal, HIGH);
digitalWrite(rightLED, LOW);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(rightSwitch) == LOW)
{
while (digitalRead(rightSwitch) == LOW);
digitalWrite(rightSignal, LOW);
digitalWrite(rightLED, LOW);
return;
}
}
digitalWrite(rightSignal, LOW);
digitalWrite(rightLED, HIGH);
for(y=0;y<10;y++)
{
delay(30);
if (digitalRead(rightSwitch) == LOW)
{
while (digitalRead(rightSwitch) == LOW);
digitalWrite(rightSignal, LOW);
digitalWrite(rightLED, LOW);
return;
}
}
digitalWrite(rightLED, LOW);
}
}
void night()
{
digitalWrite(boardLED, LOW);
digitalWrite(rightSignal, HIGH);
digitalWrite(leftSignal, HIGH);
digitalWrite(leftLED, LOW);
digitalWrite(rightLED, LOW);
delay(100);
digitalWrite(rightSignal, LOW);
digitalWrite(leftSignal, LOW);
digitalWrite(leftLED, HIGH);
digitalWrite(rightLED, HIGH);
delay(100);
digitalWrite(leftLED, LOW);
digitalWrite(rightLED, LOW);
}
void day()
{
digitalWrite(boardLED, HIGH);
delay(1);
digitalWrite(boardLED, LOW);
digitalWrite(leftLED, HIGH);
delay (1);
digitalWrite(leftLED, LOW);
digitalWrite(rightLED, HIGH);
delay(1);
digitalWrite(rightLED, LOW);
delay (5);
}
I'm really excited for this project. I'm using a Mac 10.6.8. I'm following the directions on the arduino page, but I didn't notice where or how to install the drivers and the lilypad arduino is not being recognized as a serial port. Any suggestions?
Can you upload code again?
I'm sure there are other cool differences, but those two are the biggest ones to note.
Thank's - all drivers pass me by safely during night ride