Yesterday and today I made a Arduino LilyPad led dress to wear at a wedding in Italy
I bought the black dress in a shop in Trondheim a couple of years ago.
the most difficult part for me is to sew. and to decide not to have all the funny things that I could have, like buzzer, vibe, sensor, but here the idea is to go to a party, be elegant and a bit funny but not be a clown nor try to take to much attention. so I am satisfied. and I am looking forward to vacation and party.
code
int ledPins[] = {
5, 6, 7, 8, 9, 10, 11 }; // an array of pin numbers to which LEDs are attached
int pinCount = 7; // the number of pins (i.e. the length of the array)
int brightness [] = {
0, 0, 0, 0, 0, 0, 0 };
int fadeAmount [] = {
1, 2, 3, 4, 5, 6, 7 };
void setup() {
int thisPin;
// the array elements are numbered from 0 to (pinCount – 1).
// use a for loop to initialize each pin as an output:
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
pinMode(ledPins[thisPin], OUTPUT);
}
}
void loop() {
// set the brightness of all pins
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
// turn the pin on:
analogWrite(ledPins[thisPin], brightness[thisPin]);
}
// change brightness
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
// turn the pin on:
brightness[thisPin] = brightness[thisPin] + fadeAmount[thisPin];
}
// reverse the direction of the fading at the ends of the fade:
for (int thisPin = 0; thisPin < pinCount; thisPin++) {
if (brightness [thisPin]<= 0 || brightness [thisPin] >= 255) {
fadeAmount[thisPin] = -fadeAmount[thisPin] ;
}}
// wait for 30 milliseconds to see the dimming effect
delay(30);
}
Reblogged this on The Post-Software Movement.
LikeLike