What's wrong with my code ?

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

1 answer
Sep 1, 2009. 11:40 AMAqu says:
What do you mean by that it doesn't work?
What should it do that it isn't doing?

Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!