64Views4Replies

Author Options:

how do i code a pattern of leds on a attiny 85? Answered

I am making a prop and i need to embed a attiny to run 3 leds in a specific pattern, here is the patterm
led 2 on for .75 seconds 
led 3 on for .75 seconds 
that pattern repeated 3 times then
led 1 on for a half a seconds 
then 2 on for 1/2 
then 3 on for 1/2 
that repeated twice then the whole thing restarted 

i dont so much want some code i want to learn how to do it please help

Discussions

0
None
rickharris

3 years ago

YEs? No? like? Don't like?

not the answer you wanted?

You haven't been back to read it/?

hello out there :-)

just appreciate some feed back to keep me answering questions here>

0
None
icengrickharris

Answer 3 years ago

15 yr old kids don't have social skills or empathy.

BTW your basic program is sooo much easier then the equivalent c code.

0
None
rickharrisiceng

Answer 3 years ago

:-) I got carried away, just needed some kind of feedback so I know I am not talking to myself!

Picaxe is a very powerful system and MUCH MUCH easier to use than Arduino IMHO 14 microprocessors from 8 pin up to 40 pin and over 250 commands available.- Not so fast in operation as some though, however for many projects that isn't an issue.

Cheap too.

0
None
rickharris

3 years ago

https://www.sparkfun.com/products/10803

For something this simple you can best use an easy to program micro processor. Available from Sparkfun for $2.95 this should fit your needs.

The diagram shows 3 LEDs connected - The 470 ohm resistor can be smaller if you need brighter LEDs - 470 give you about 10 mA 330 give you about 15 mA the max is 20 Ma per output.

The program is very easy - the manuals (see link below) will tell you all about how to do this and what you need 9a cheap cable to connect and i would suggest a small bread board the the picaxe bread board programming jack.

Prog:

start:

for b1= 1 to 3

high 2

pause 750

low 2

high 4

pause 750

low 4

next b1

for b1=1 to 2

high 1

pause 500

low 1

high 2

pause 500

low 2

high 3

pause 500

low 4

next b1

goto start

that's all you need!

I assumed you want the LED's turned OFF after the time - you don't actually say.

If you need this explained Pm me or ask here

http://www.picaxe.com/Getting-Started/PICAXE-Manua...

08 ligt flasher.jpg