I am using a MaxSonar module to determine distances with a 28x2. I capture the code but not sure how convert it to a value I can do something with. The plan is to use this to determine a "clear path" for the object-avoiding bot.
The output is an ASCII capital “R”, followed by three ASCII character digits representing the range in inches up to a maximum of 255, followed by a carriage return (ASCII 13). The baud rate is 9600, 8 bits, no parity, with one stop bit.
After reading some threads, I am still not clear on this. I tried new code
If w0 is the decimal value, it does not make sense. Where am I going astray here?
The output is an ASCII capital “R”, followed by three ASCII character digits representing the range in inches up to a maximum of 255, followed by a carriage return (ASCII 13). The baud rate is 9600, 8 bits, no parity, with one stop bit.
After reading some threads, I am still not clear on this. I tried new code
Code:
h:
debug
serin a.3,n9600,("R"), b0,b1,b2
w0 = b2 * 10 + b1 * 10 + b0 - 5328
pause 400
goto h
Last edited: