Shop OBEX P1 Docs P2 Docs Learn Events
BS2..QTI sensors and Infrared headlights — Parallax Forums

BS2..QTI sensors and Infrared headlights

ur5pointos2slour5pointos2slo Posts: 19
edited 2008-11-07 03:00 in BASIC Stamp
I was wondering if anyone knew of a way to use the QTI line sensors and the infrared headlights at the same time. I cannot figure a way to hook them both up due to lack of room. Basically I need to make the bot follow a line and when the infrared detects the wall it will stop, do what it needs to do, do a 180 and repeat the process. Any help would be appreciated. Thankshop.gif

Comments

  • FranklinFranklin Posts: 4,747
    edited 2008-11-06 01:52
    Are you talking of lack of room on the bot or in code? You may have to make a bracket if you are talking physical room and you need to attach your code if that is your problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • ur5pointos2slour5pointos2slo Posts: 19
    edited 2008-11-06 02:01
    Yes I am referring to lack of physical room sorry for the confusion. I have the ir headlights hooked to the board, but cant think of any ways to actually hook the qti sensors up as well. This is an educational bot btw.
  • MSDTechMSDTech Posts: 342
    edited 2008-11-06 03:43
    Normally you mount the QTI sensors under the bot. If you are running out of pins, you might look at the faster routie in:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/robo/FasterQtiSubroutineV1.1.pdf
    It only requires 4 pins for 4 sensors instead of the 6 pins used in the three sensor setup.
  • ur5pointos2slour5pointos2slo Posts: 19
    edited 2008-11-06 12:52
    MSDTech said...
    Normally you mount the QTI sensors under the bot. If you are running out of pins, you might look at the faster routie in:
    http://www.parallax.com/Portals/0/Downloads/docs/prod/robo/FasterQtiSubroutineV1.1.pdf
    It only requires 4 pins for 4 sensors instead of the 6 pins used in the three sensor setup.
    Yes I did mount the sensors under the bot. I was only doing the 3 sensor setup I will take a look into the 4.
  • ur5pointos2slour5pointos2slo Posts: 19
    edited 2008-11-06 13:21
    Ok I took a look at the 4 sensor setup. Is there any way I could possibly move all the components down the board to lets say with the blue wires in p0-p3? If so how would I need to modify the basic stamp code to make the sensors work on this part of the breadboard? I have no experience with these bots or programming sorry if I am making this difficult.

    Post Edited (ur5pointos2slo) : 11/6/2008 1:30:06 PM GMT
  • MSDTechMSDTech Posts: 342
    edited 2008-11-06 15:23
    If you look at the code, you will note it uses the predefined variables DIRB and INB these are a way of working with pins 4 through 7 as a unit. Pins 0 through 3 can be addressed as a similar unit DIRA and INA. Likewise, Pins 8 to 11 are INC and 12 to 15 are IND.
  • ur5pointos2slour5pointos2slo Posts: 19
    edited 2008-11-06 16:50
    MSDTech said...
    If you look at the code, you will note it uses the predefined variables DIRB and INB these are a way of working with pins 4 through 7 as a unit. Pins 0 through 3 can be addressed as a similar unit DIRA and INA. Likewise, Pins 8 to 11 are INC and 12 to 15 are IND.
    Thank you that makes sense. I had tried to hook it up previously using pins 0 to 3 with the same code and couldnt figure out what I needed to change. I will try that and hopefully be able to use both infrared and qti sensors now.
  • ur5pointos2slour5pointos2slo Posts: 19
    edited 2008-11-07 01:54
    Ok I got the qti sensors to work properly. Now my problem is taking the infrared headlight setup and moving it up the board so I can use the qti sensors and the headlights simultaneously. When looking at the diagram for the ir headlights in the·"robotics with·boe-bot·book" page 239.·I was thinking I could possibly just use p8 and p9 instead of p0 and p2 and then use p14,p15 instead of p8,p9 I do not know if this is possible if anyone has any solutions please let me know. Thanks
  • MSDTechMSDTech Posts: 342
    edited 2008-11-07 03:00
    It doesn't matter which pins you use - just remember to adjust the code. This is why the texts recommend you use a name for the component connection. I always have one section that lists all the pins and gives them symbolic names. That way if I have to rearrange the connections, I only need to change one line of code.
    A good description is in the Editor help file under the "Elements of PBASIC Style".

    Post Edited (MSDTech) : 11/7/2008 3:05:48 AM GMT
Sign In or Register to comment.