79Views1Replies

Author Options:

What's wrong with my code ? Answered

Hello , i am using PICBASIC PRO to send an RC-5 code which would theoretically send a Standby message to a phillips TV ... each time a new bit is sent a subroutine is called ...i tested the program and it runs correctly BUT it does NOT work ... does anybody have any idea why isnt it working ? here is the code i wrote :

DEFINE OSC 20
val var byte
val=0
mainRoutine:
gosub log1
gosub log1
goto tog
cmd:
'Send the Adress
gosub log0
gosub log0
gosub log0
gosub log0
gosub log0
'Send the Command
gosub log0
gosub log0
gosub log1
gosub log1
gosub log0
gosub log0
pause 114
goto mainRoutine

log1:
low 0
pauseus 889
high 0
pauseus 889
return

log0:
high 0
pauseus 889
low 0
pauseus 889
return

tog:
if val == 0 then
val =1
gosub log0
goto cmd
endif

if val == 1 then
val =0
gosub log1
goto cmd
endif

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.
0
Aqu
Aqu

11 years ago

What do you mean by that it doesn't work?
What should it do that it isn't doing?