Let's Make Robots!

srf05 measurements to lcd readout - code snippets?

Hello, here I am again, asking for some help. I am currently using fritsl's srf05 code:


symbol trig = 3 ‘ Define output pin for Trigger pulse
symbol echo = 6 ‘ Define input pin for Echo pulse
symbol range = w1 ‘ 16 bit word variable for range

pulsout trig,2 ‘ produce 20uS trigger pulse (must be minimum of 10uS)
pulsin echo,1,range ‘ measures the range in 10uS steps
pause 10 ‘ recharge period after ranging completes
‘ now convert range to cm (divide by 5.8) or inches (divide by 14.8)
‘ as picaxe cannot use 5.8, multiply by 10 then divide by 58 instead
let range = range * 10 / 58 ‘ multiply by 10 then divide by 58
debug range ‘ display range via debug command
goto main ‘ and around forever


and am wondering if anyone can give me a code snippet for sending the distance measurement to my lcd.


my screen: http://www.hvwtech.com/products_view.asp?ProductID=508 



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
thankyou for the info
This will be a simple serial-out command but the baud rate will give you an issue. First off, go to the picaxe website and find the manual for the picaxe brand LCD. This will give you your serout commands. Now the picaxe LCD's work at 2400 baud and yours is 9600... You first need to overclock your picaxe up to 8mhz using the setfreq command. Next, using the commands found in the picaxe LCD data-sheet, substitute N9600_8 instead of the N2400 and if that does not work, try T9600_8 (I'm not sure if your LCD uses inverted signals or not). From there, the data sheet that came with your hvwtech screen should have any or all special commands you would need to clearscreen, set the cursor, etc.