Shop OBEX P1 Docs P2 Docs Learn Events
Quick Question — Parallax Forums

Quick Question

AndroidAndroid Posts: 82
edited 2012-07-12 16:04 in General Discussion
Can Ping))) sensor be controlled by outh and dirh? Because I connected a 7 segment LED digit display to my boe-bot with Ping))) sensor and servo and it started acting up
- Android

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-11 09:31
    It depends on where you connected the Ping))) sensor. OUTH / DIRH control I/O pins 8-15. Whenever you change either OUTH or DIRH, you affect all of the I/O pins 8-15 at the same time. Of course, it also depends on the values you assign to OUTH and DIRH. For specific advice, you'll have to post a schematic or at least a detailed description of what you have connected to I/O pins 8-15 and provide a listing of your source code.
  • AndroidAndroid Posts: 82
    edited 2012-07-12 10:50
    The Ping sensor is connected to #15 in the servo port area (don't know what its called) And the 7 seg. LED display is connected in the way described in WAM activity kit 3.0.
    thank you Mike
    -Android
  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-12 11:37
    The connector marked #15 in the servo area is the same as I/O pin 15 elsewhere. When you change DIRH or OUTH, you're changing I/O pin 15 as well as I/O pins 8-14. It's possible to connect things up as you have, but you need to be careful about the use of DIRH and OUTH. Normally, any I/O pin used for a PING is left in input mode. When you set DIRH, make sure that the most significant bit of the 8-bit value assigned to DIRH is a zero. That will ensure that I/O pin #15 is in input mode. LOW, HIGH, and PULSIN should work normally with I/O pin 15 as long as you don't change DIRH or OUTH while you're making a PING reading.

    None of this will work if you're trying to use I/O pin 15 for one of the LED pins. In that case, you'll have to move the PING to one of the I/O pins in the range 0-7 or move the LED to I/O pins 0-7 and leave the PING connected to I/O pin 15.
  • AndroidAndroid Posts: 82
    edited 2012-07-12 16:04
    Thank you so much for the replies Mike
    -Android
Sign In or Register to comment.