control leds with picaxe software

Thread Starter

nyyankeehater

Joined Oct 21, 2008
1
im trying to flash 4 leds with multiple flash patterns but i need to know the command(s) to flash all 4 of them at the same time. everything i try flashes them in sequence. please help!
 

RiJoRI

Joined Aug 15, 2007
536
One way to do it would be to set up four counters, and an "LED image" variable.
Load the counters with different numbers.
Run a loop like this:

Rich (BB code):
Loop:
       Decrement counter1
       if Counter1 == 0 then
            Reload Counter1
            Toggle LED1 bit in the LED image
       end if
       Repeat for the other counters
       Send the LED image to the LED port
endloop

Using the image allows you to send out different ON and OFF commands simultaneously.

--Rich
 
Top