Shop OBEX P1 Docs P2 Docs Learn Events
EZ4 Sonar program for BS2 — Parallax Forums

EZ4 Sonar program for BS2

milton hachemilton hache Posts: 6
edited 2009-03-19 23:23 in BASIC Stamp
I would like to know if the Dubug ? in and Bubug ? out of this program are done correctly.
·Since I have a pause after these commands, shouldn’t I see the outputs stages oscillate between o and 1?


I am trying to turn on Pins 13 and 10 for some seconds and then turn them off. Also if the IF statement stop being true I want the pins to come off even if they are already on.

I also want that if the IF statement is not true this pins don't come on.


Post Edited (milton hache) : 3/19/2009 10:27:51 PM GMT

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-03-11 00:50
    Does the code work? What does it do when you run it? A little help here, please..

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • LilDiLilDi Posts: 229
    edited 2009-03-11 02:02
    Haven't looked at your code, but here are some things to consider. There are three output schemes on this sensor. A serial data Tx/Rx port, analog out, and pulse width out. I like to use the pulse width output and read the distance with a PULSIN command.
    All interfaces are active
    simultaneously
    · Serial, 0 to Vcc
    · 9600Baud, 81N
    · Analog, (Vcc/512) / inch
    · Pulse width, (147uS/inch)

    Also in your schematic, you really only need to connect the +5, Ground, and PW pin of the sensor. assuming you're going to use the pulse width output scheme.

    Post Edited (LilDi) : 3/11/2009 2:16:59 AM GMT
  • JDJD Posts: 570
    edited 2009-03-19 23:23
    Milton,

    It looks like all the communications are still active within the program; did you have an idea of which method that you wanted to use to read the sensor? As LilDi requested for clarification, but I have not seen a confirmation on which one that you wanted help with.

    Did you want to use Serial, Analog, or Pulse Width for the communication with the sensor?

    From there we can help take out code that isn't needed, or suggest commands that would best suit your needs.

    Thank you

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
Sign In or Register to comment.