Shop OBEX P1 Docs P2 Docs Learn Events
Help programming ping))) — Parallax Forums

Help programming ping)))

John7John7 Posts: 1
edited 2010-12-02 07:30 in Accessories
Hello,

I'm a student from Fontys Hogescholen in Eindhoven (Netherlands).
I have a question, i'm using the ping))) for measuring distance for our
robot.
I want program this sensor in C with a pic18f4550 microcontroller.
Is it possible to help me writing a program in C.

Greetings John Wijnen

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-12-02 07:30
    We cannot help you with the actual PIC programming. The PING))) documentation is pretty explicit about the way the PING))) functions. The way you use it with a PIC18F4550 is not very different from how you'd use it with a Stamp or a Propeller. The PING))) has to be connected to an I/O pin and power/ground.

    1) The I/O pin has to be made an output low, then the output has to be pulsed high for a few microseconds (at least 5us), then back to low for a few microseconds.

    2) The I/O pin has to be made an input and the microcontroller has to wait (roughly 750us) for the input to go from low to high.

    3) The microcontroller has to time how long the input pulse remains high, up to 18.5ms

    4) There is a minimum of about 200us before this cycle can begin again.
Sign In or Register to comment.