fishyghost
New Member
I am having a few issues with the SRF04. I have followed the Devantech instructions for Picaxe chips - connect the do not connect pin to ground. But the variable that I set the pulsin to constantly stays as 0. Why?!
My Test Code
When turned on this code makes Motor B go forward and motor A turn on for a moment then off then on etc...
**broken link removed**
Supply is connected to my supply
Echo Pulse Output is connected to Input 7 (Positive Pin)
Trigger Pulse Input is connected to Output 0 (Positive Pin)
Do Not Connect is connected to Ground
0v Ground is connected to Ground...
Just as this page tells me to:
https://www.robot-electronics.co.uk/htm/srf04tech.htm
I am using the Toyota Challenge board.
My Test Code
Code:
Symbol Tm = w0
Symbol RInches_10 = w1
Symbol TrigPin = 0 ' PICAXE Output
Symbol EchoPin = 7 ' PICAXE input
Pause 1000 ' allow system to settle when booting
forward B
TOP:
forward B
PulsOut TrigPin,1
PulsIn EchoPin,1,Tm
If Tm= 0 Then OverRange
backward B
pause 400
RInches_10 = Tm * 33 / 50 ' assumes 10 us per tick on pulsin
Goto TOP
OverRange:
forward A
Pause 1000
halt A
Goto TOP
When turned on this code makes Motor B go forward and motor A turn on for a moment then off then on etc...
**broken link removed**
Supply is connected to my supply
Echo Pulse Output is connected to Input 7 (Positive Pin)
Trigger Pulse Input is connected to Output 0 (Positive Pin)
Do Not Connect is connected to Ground
0v Ground is connected to Ground...
Just as this page tells me to:
https://www.robot-electronics.co.uk/htm/srf04tech.htm
I am using the Toyota Challenge board.