Help with Ping))) sensor with Atom Pro 28

I’m trying this real simple code I cut and pasted from various “sticky” on this section of the forum. I connected my ping))) sensor on the AX1 pin, with the 5V jumper that powers the AX0-AX3’s center pins. Here is the code I’m trying:

;ABB Pin Label<-> ATOM PRO Pin name
;AX0 <-> P19
;AX1 <-> P18
;AX2 <-> P16
;AX3 <-> P17

pingvalue var word
pingport con P18

getping
	low pingport
	high pingport
	pulsin pingport, 0, pingvalue
	low pingport
	pingvalue = pingvalue / 2
	serout s_out,i9600,[DEC pingValue]
	pause 1000
goto getping

All I get is a succession of zeros in my terminal 1 (that i’m using for debug messages with the serout s_out command)

ok, one of my problem was that i was connecting it to the AtoD port?

I tried P5 instead, now the “ACT” light comes on and pulses, but I’m still getting successions of zeros.

What am I doing wrong?

pingvalue var word
pingport con P5

getping
   low pingport
   high pingport
   pulsin pingport, 0, pingvalue
   low pingport
   pingvalue = pingvalue / 2
   serout s_out,i9600,[DEC pingValue]
goto getping

I have not tried out a Ping yet (I purchased one in my last order, but have not used it yet…).

But looking at the old threads, I believe you need to do a pulse out first to start the ping… Probably something like:

[code]pingvalue var word
pingport con P5
PING_Trigger con 10 ’ Trigger pulse length in uS (Must be 10 for Atom PRO)

getping
low pingport
pulsout pingport, PING_Trigger
pulsin pingport, 0, pingvalue
low pingport
pingvalue = pingvalue / 2
serout s_out,i9600,[DEC pingValue]
goto getping
[/code]

Note, in the thread by LynxGuy I believe the scaling may be different, but you might check first to see if you at least get a non-zero value…

Kurt

Thanks kurte, I’ll give that a whirl when I get home… I’m actually the same as you with the Ping sensor, I ordered it sometime after the new years, and haven’t really hooked it up yet. Just wanted to try to see if it was alive lately cause I needed a break from doing IK and vector/positional transformation programming for my hex.

I did check out my GP2D12 though. It is functional, but due to the voltage divider circuit that Jim mentioned in another thread, the ranging is cut down in half.

Just getting my sensors ready when my hexy starts walking…

Well, I had a few free minutes so I plugged mine in to an ABB board (p5) and cut and paste the code in from my previous post and I got all zeros. So I moved it to P0 and tried it again and then I started getting valid input. So remembering on the “Old” ABB boards we have the switches and LEDS on P4-P6. So I moved it back to P5 and removed the jumpers and I started to get valid input.

I hope this helps
Kurt

P.S. - I will interested to see your IK code when it is working…

Ohhhh… yeah, the LEDs, forgot about those… This could be my problem, thanks!

That was exactly it. P4-P6 was taken up by the LED if you leave the jumpers on. :blush:

I moved the Ping))) to P8 and the sensor worked flawlessly. I actually like this sensor more then what my GP2D12 was putting out.

I guess I use my GP2D12 as a backup if my Ping))) sensor wiggles out when hitting a soft object…

Thanks again kurte!

:smiley:

Glad it worked.

Kurt

Hey Tom:

Can you post a schematic of your wiring up of the sensor to the bot board please?

Thanks amigo,

Migs