5 LED Fade Slow in Sequence

Facebooktwittergoogle_plusredditlinkedintumblrmailFacebooktwittergoogle_plusredditlinkedintumblrmail

New video on The eTextile Lounge youTube channel!.

You can also watch this on the eTextile Lounge youTube channel.

Arduino Code can be uploaded to ATtiny45 using the Arduino as ISP Tutorial.

/*Five LED Fade Slow in SEQUENCE*/
/*Arduino Uno v.1.0.3 as ISP for Atmel ATtiny45 internal 8MHz clock*/
/*using software PWM*/
/*14 Ocotber 2014*/
/*lynne bruning for The eTextile Lounge*/
/*http://etextilelounge.com*/

/* credit Hannah Perner-Wilson’s Soft and Tiny Workshop November 2012*/
/*http://www.kobakant.at/DIY/?p=3655*/
/*altered timing 4 June 2013 by lynne bruning for use at SDA teaching workshop*/

#define fadeSpeed 20

void setup()

{
for(int pin=0;pin<5;pin++) pinMode(pin, OUTPUT); } void loop() { for(int pin=0;pin<5;pin++) { for(int fade=1;fade<184;fade++) //fade on { softPWM(pin, fade, fadeSpeed); } for(int fade=184;fade>1;fade–)

//fade off
{
softPWM(pin, fade, fadeSpeed);
}

}

}

void softPWM(int pin, int freq, int sp)

// software PWM function that fakes analog output
{
digitalWrite(pin,HIGH); //on
delayMicroseconds(sp*freq);
digitalWrite(pin,LOW); //off
delayMicroseconds(sp*(185-freq));
}

When you upload the code you will receive the following information on the Arduino window:

Binary sketch size: 816 bytes (of a 4,096 byte maximum)

Error Messages – Ignore
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45
avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny45

 

Enjoy!

Facebooktwittergoogle_plusredditlinkedintumblrmailFacebooktwittergoogle_plusredditlinkedintumblrmail