SRF005

russbow

Senior Member
I am sorry, I seem to still have a problem with pin numbering.

I am now playing ith the SRF 005. I understand the trgger out on (output) pin 6, but cannot figure out hoe to resd the returning signal.

I am using this code, ripped off the SRF data sheet :-
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
main:
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
When I run the simulator, output pin 3 ( physical leg 24 ) flashes as does the TXD (physical 7)

I cant equate the TXD with echo=6 'define input pin above. Should I be using an ADC input or input 6 ( physical 17) By the way, 28x1 chip

thanks, Russ
 

eclectic

Moderator
@russbow

First, print out the picture, from Manual 1 page 28.

Then perhaps silly, but ...

The Picaxeopod has 28 legs, outside, which you can see and touch.
But, you can't see the Points INSide. :)
or
Parts INSide.

And yes, if you follow the SRF005 program,
it's input PIN 6 which is inside LEG 17.

(and you cannot simulate the SRF005 input :-( )

e
 

Attachments

Last edited:

russbow

Senior Member
Gentlemen, thank you. Now all sorted.I am beginning to find my way through the maze. Found searching the threads most useful. I was using the ula array (wrong) and found the SERTXD command (brill). So of to generate the next problem.

R.
 
Top