problems with debug

im trying to debug the signal from a ldr but as soon the debug screen comes up it stops on debug 1. i got the light level as 196 but it didn't keep debugging. has anyone else had the same problem and is this a bug?

any help would be appreciated
 

hippy

Ex-Staff (retired)
Are you repeatedly executing the DEBUG command within your code ?

This will only display one debug reading ...<code><pre><font size=2 face='Courier'> DEBUG b0
DO
READADC 1,b0
LOOP </font></pre></code> This is what you actually want ...<code><pre><font size=2 face='Courier'> DO
READADC 1,b0
DEBUG b0
LOOP </font></pre></code>
 
yea it works now but is it possible for me to debug infrain2 because i pulled an old rc car remote apart and found an led which sends the signal but couldn't find out what signal it sends. if it is what would be the code for it then?

Edited by - annoyin_kid on 13/01/2007 02:21:47
 

hippy

Ex-Staff (retired)
Not sure exactly what you mean by 'debug infrain2' the value returned by that command is put into 'b13' on an 08M and in 'infra' on the 18X etc. That value is displayed in the debug window along with the rest, so just put a DEBUG command after INFRAIN2.

If you mean, how to find what protocol or thepulse train the remote is putting out then - if the remote has an identifiable chip in it the datasheet will likely provide details, otherwise you'll need an IR LED protocol analyser ( Google may help there, LIRC etc may include such things ), a scope or a lot of bit-banged experimenting.

INFRAIN/2 only accept Sony IR Commands and not all remotes send that. Take a look at ...

http://www.hippy.freeserve.co.uk/picaxeir.htm

and especially the IR Remote Tester. That will let you test if the remote is even working or not.
 
i ended up cutting the infra red reciever part of the rc car which was joined to the main circuit board with three wires and joined it to my bread board. i used infrain2 and tried a range of values for &quot;infra =&quot; but gave up very fast

i put the red wire to v+, yellow to i/o1 and black to v-

i used readadc on that pin and then debugged it and it turned out that when i press any button on my tv remote or the rc car remote the signal is &quot;1&quot;.

i then used this code:

start:
readadc 1,b1
if b1 =1 then led
'debug
goto start

led:
high 2
low 2
goto start

and when i pressed one of the four buttons on the remote the led flashed at different rates/patterns for a short period of time. i then figured it must be sending data. is there any way that picaxe can record and access this information?

the rc car i am playing around with is an old, cheap one. it can only do 4 things:
set an alarm which activates when you touch the car, make the sound of an engine starting up, make the sound of a moving car while the wheels turn and make the sound of a horn
 
Top