Shop OBEX P1 Docs P2 Docs Learn Events
coding for boe and ping — Parallax Forums

coding for boe and ping

ThirteenevenThirteeneven Posts: 11
edited 2009-02-11 17:17 in BASIC Stamp
Hi
I am using a boe and basic stamp 2 and ping sensor. I am using a robotic arm that is run completely in C++. Up until this we got the boe and ping we used a phidgetts analog interface. We still use the phidgetts board but we need to use boe to get ping sensor readings. My question is, is there a way to send out an analog signal from the reading of the ping sensor, that you get from the boe, to the phidgetts board so we can take that signal and use it in C++. Also we are using 2 ping sensor and I need to get readings from both to the phidgetts board.

Please Help
Thank you
Josh

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-02-11 17:05
    You can't change the Ping module. You need to send it a pulse to start, and measure the return pulse width.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-11 17:09
    Look at the PWM statement chapter in the Stamp Basic manual. With a couple of passive components (resistor and capacitor), this can be used to produce an analog voltage ... the manual goes into the details. There's sample code for getting readings from a PING and you can duplicate the code with different pin numbers to handle two PINGs. This will give you two numbers (for the distances) which you can use with PWM statements to generate two analog signals. The output filter for the PWM can hold the analog voltage for a short time, particularly if you use an op-amp buffer or the analog interface doesn't load down the analog signal, enough so you can do two PING readings and two PWM statements in a repeating cycle.
  • ThirteenevenThirteeneven Posts: 11
    edited 2009-02-11 17:17
    Mike

    This will allow me to send an analog signal from the boe to the phidgetts board so I can read it on the phidgetts board

    Thanks
    josh
Sign In or Register to comment.