int timer = 100; // The higher the number, the slower the timing.
int pins[] = { 3, 5, 6, 9, 10, 11 }; // PWM pins
int num_pins = 6; // the number of pins
int value = 0; // start at value 0
void setup()
{
int i;
for (i = 0; i < num_pins; i++) { // 0 to num_pins - 1
pinMode(pins[i], OUTPUT);
}
}
void loop()
{
int i;
for (i = 0; i < num_pins; i++) { // loop
for(value = 0 ; value <= 255; value+=5) { // fade in
analogWrite(pins[i], value); // write value to pin
delay(2);
}
for(value = 255; value >=0; value-=5){ // fade out
analogWrite(pins[i], value);
delay(2);
}
}
for (i = num_pins - 2; i > 0; i–) {
for(value = 0 ; value <= 255; value+=5) {
analogWrite(pins[i], value);
delay(2);
}
for(value = 255; value >=0; value-=5){
This is the first thing I’m making out of the jewelry making supplies I’ve accumulated recently. I’m signed up for a real class so this is just an experiment. The corners were particularly difficult. Anyway, simple but somehow catchy.
I spent Saturday at a girlfriend’s house (the weekend actually, which is why this post is late). I took a picture of her window. It overlooks a beautiful lake. The stained glass was made for a neighbor and this was what they saw from the neighbor’s house. The terrain is only slightly different as they are only four houses down. The art was a gift to my friend when the neighbors changed the shape of their window and could no longer use the art.
Glow stick painting of a light bulb. The texture at the bottom was the broken glass. The top was faded because it was cold outside. My boyfriend suggested giving it a little life with the blowtorch but I declined as we were already on my neighbor’s driveway (it was darker than ours).
My thing today was supposed to be an ATC with a little robot on it with LED eyes that light up when you touch the pad. Unfortunately, my design is flawed and my touch switch doesn’t work the way I need it to. Apparently humans aren’t nearly as conductive as metal. Sux. I’m reworking my design and will post when complete. In the meantime here is the original PCB.
Making an LED fade in and out using the Arduino platform.
yay!
****************************
int ledPin = 9;
int value = 0;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
for(value = 0 ; value <= 255; value+=5) { // fade in (from min to max)
analogWrite(ledPin, value); // sets the value (range from 0 to 255)
delay (10);
}
for(value = 255; value >=0; value-=5){ // fade out (from max to min)
analogWrite(ledPin, value);
delay(10); // sets the value (range from 0 to 255)
}
}