Hi everyone,
I have a simple project consisting of one 08M2, and I have to generate 2 different continuous clock frequency on pin c.4,c.0 while pin c.1, c.2 are use for led.
the main problem I've got is using a do,loop with toggle work, but the 2 different frequency have to run shifted, eg: first frequency is 200Hz, and the second is 225Hz.
the second frequency has to be slower than the fist one for few Hertz.
any suggestions will help.
Thanks again
I have a simple project consisting of one 08M2, and I have to generate 2 different continuous clock frequency on pin c.4,c.0 while pin c.1, c.2 are use for led.
the main problem I've got is using a do,loop with toggle work, but the 2 different frequency have to run shifted, eg: first frequency is 200Hz, and the second is 225Hz.
the second frequency has to be slower than the fist one for few Hertz.
any suggestions will help.
Thanks again
Code:
#picaxe 08m2
#NO_DATA
;#Terminal 4800
setfreq m16 ;32
b0 = 0: b1 = 0 : b2 = 80 : b3 = 86
DO
b0 = b0 + 1
b1 = b1 + 1
if b0 = b2 then
TOGGLE C.0
b0 = 0
endif
if b1 = b3 then
TOGGLE C.4
b1 = 0
endif
LOOP
Last edited: