Using DEBUG effectively
Morrolan
Posts: 98
Hi, I'm writing a very small program that as yet is completely untested, so please excuse me if the program doesn't appear to make much sense yet - I am simply more concerned over the appearance of seemingly random characters in the debug window?
Whereas the output should be simply:
randw = 27687
randb = 108
The code that is producing this is below:
This is using a BS2e and a servo controller board from a UK company called Milford Instruments (hence why the SEROUT might not make immediate sense).
But, why does the debug window show an L at the beginning in the example above, and the Ty? I've looked at DEBUG in the syntax and reference manual but it doesn't go into enough detail to clear this up for me.
Many thanks in advance,
Morrolan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.
lrandw = 27687 randb = 108 Tÿ
Whereas the output should be simply:
randw = 27687
randb = 108
The code that is producing this is below:
' {$STAMP BS2e} ' {$PBASIC 2.5} sync CON 255 ' Sync byte set to 255 servo VAR Byte ' Servo Number position VAR Byte ' Servo position n96n CON $4054 ' Comms set to 9600 baud (look into this stuff) signal CON 11 ' Controller set to pin stamp pin 11 randw VAR Word 'Seed and result for RANDOM. randb VAR Byte 'Returned result. Main_Loop: servo = 0 RANDOM randw randb = randw / 256 DEBUG DEC ? randw, DEC ? randb position = randb SEROUT signal,n96n,[noparse][[/noparse]sync,servo,position] PAUSE 3000 GOTO Main_Loop:
This is using a BS2e and a servo controller board from a UK company called Milford Instruments (hence why the SEROUT might not make immediate sense).
But, why does the debug window show an L at the beginning in the example above, and the Ty? I've looked at DEBUG in the syntax and reference manual but it doesn't go into enough detail to clear this up for me.
Many thanks in advance,
Morrolan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.
Comments
Below I have attached a link and image - unfortunately they don't provide a schematic of the board, but hopefully the picture might help.
The only thing I can think of is that I didn't actually have the servo's connected to the board when I was testing this, so could that be the cause of the noise at all? The servo's connect to the header pins on the right - I'm wishing that I'd just waited for them to get the Parallax servo controller back in stock rather than buy theirs! The code still works by the way, but I'm curious about the debug rather than worried.
http://www.milinst.com/animatronics/animsside.htm
(it is the servo 8 controller)
Many Thanks,
Morrolan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Flying is simple. You just throw yourself at the ground and miss.
Post Edited (Morrolan) : 9/19/2007 12:18:19 PM GMT