Not been dabbling for a while

Lez T

Member
Due to a health issue I haven't been dabbling for a while, could someone please point me in the right direction as to why this will switch on and off at the desired interval.

main:

if pin1 = 0 then main
if pin1 = 1 then lev1

lev1:
wait 5
high 2
wait 5
low 2
goto main:

But if I use PWM as in:

main:

if pin1 = 0 then main
if pin1 = 1 then lev1

lev1:
wait 5
pwmout 2, 199, 400
wait 5
low 2
goto main:

the switching does not work.
Many thanks.
Lez.
 

Lez T

Member
Pete, thanks mate, using an 08M for getting back into things, just found the answer in the manual ... need to actually switch off the PWM command

as in

lev1:
wait 5
pwmout 2, 199, 400
wait 5
pwmout 2, 0, 0
low 2
goto main:

And probably do not need the low 2 command either.
Thanks again.
Lez.
 
Top