I'm trying to make car parking place radar because one parking slot is situated in a narrow place so it's hard to reverse back there. Picaxe situated in parking slot is using ultrasonic sensor and it's sending trough picaxe urf module if there is a car or not. Picaxe situated in my car is using erf module and it will tell if place is free. Now I have tried to test how this combo system works together but despite many attempts I haven't got them to work so I'm asking you if you have any idea how to proceed in this project.
PICAXE URF SENDER CODE
PICAXE RECEIVER CODE
PICAXE URF SENDER CODE
Code:
'URF RX to PICAXE B.7
'URF TX is Floating
'URF CTS to 0V
symbol distance = w0
symbol trigger = B.1
symbol echo = B.0
setfreq m8
main:
low b.7 'transmitter rx need to be LOW.
pulsout trigger, 2
pulsin echo,1, distance
pause 10
let distance = distance * 5 / 58
if distance > 10 then
b2 = 1
serout b.7, n9600, (b2)
end if
if distance < 10 then
b2 = 0
serout b.7, n9600, (b2)
end if
'debug distance
pause 100
goto main
PICAXE RECEIVER CODE
Code:
#picaxe 28X2
; ERF RX to PICAXE TX (C.1)
; ERF TX to PICAXE RX (A.2)
; ERF CTS to 0V
setfreq m8
low B.4 ; NB! ensure ERF RX is held low
; even when not used in this program
main:
serin A.2, n9600_8, (b0)
debug
goto main