Bill.b
Senior Member
I quickly hooked up this ultrasonic radar scanner on my axe091 simulator and downloaded PLX-DAQ serial to excel freeby. sorry i do not have the link
but google should locate the site.
I used only one servo to scan a SFR005 ultrasonic unit.
picaxe 18m2
servo connected to b.0 (pin 6)
SFR005 output connected to b.3 (pin 9)
this is the excel screen
View attachment 10133
regards Bill
but google should locate the site.
I used only one servo to scan a SFR005 ultrasonic unit.
picaxe 18m2
servo connected to b.0 (pin 6)
SFR005 output connected to b.3 (pin 9)
Code:
#picaxe 18m2
#No_Data
pause 1000
setfreq m8
symbol servoCount = b0
symbol counter1 = b1 'counter
symbol asciihd = b2
symbol asciiten = b3
symbol asciiunit = b4
Symbol range = w10 'front range sensor register
Symbol trig = b.3 'front range sensor ADC input
Symbol SERVO1 = b.0 'Pan servo output
Symbol SERVO1_MIDDLE = 145
servo servo1,SERVO1_MIDDLE
main:
gosub scan1
goto main
scan1:
for counter1 = 1 to 80
servoCount = counter1+40
ServoPos SERVO1,servoCount
pulsout trig,2 ' produces about 20uS pulse (must be minimum of 10uS)
pulsin trig,1,range ' measures the range in 10uS steps
pause 10 ' SRF005 mandatory 10mS recharge period after ranging completes
let range = range * 10 /29 ' multiply by 10 then divide by 29 (8meg)
bintoascii range,asciihd,asciiten,asciiunit
sertxd ("DATA,",asciihd,asciiten,asciiunit,13,10)
pause 200
next counter1
sertxd ("CLEARDATA,",13,10)
return
View attachment 10133
regards Bill