Shop OBEX P1 Docs P2 Docs Learn Events
QTI Help — Parallax Forums

QTI Help

SpencerSpencer Posts: 17
edited 2006-01-08 17:18 in BASIC Stamp
I'm having some problems with the QTI kit for the BOE-Bot. I have hooked up the circuit test circuit exactly as it is shown in the documentation except that I have replaced pins 3,5,6, and 7 with 0,1,2, and 3 respectively. For some reason, the only sensor that works properly is the one connected to pin 3. I have had the wiring checked and double checked by outside parties and I have tried swapping QTI's in case of faults. Nothing works. The code is exactly the same as it appears in the documentation, except for the difference in pins. Any ideas as to what the problem might be would be greatly appreciated.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-08 02:02
    Are you sure the code if correct? Just in case, why not post it and let us have a look. wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • SpencerSpencer Posts: 17
    edited 2006-01-08 13:47
    Here's the code I'm using:

    qtiLeft VAR Bit
    qtiCenter VAR Bit
    qtiRight VAR Bit

    DO

    HIGH 1: PAUSE 1: qtiRight = IN0: INPUT 1
    HIGH 2: PAUSE 1: qtiCenter = IN0: INPUT 2
    HIGH 3: PAUSE 1: qtiLeft = IN0: INPUT 3

    DEBUG HOME, BIN1 qtiLeft, BIN1 qtiCenter, BIN1 qtiRight

    Pause 100

    LOOP


    As I said before the only one that is properly functioning is the one attached to pin 3
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-01-08 14:34
    Spencer -

    To compare the code you're using, and the test code below, as supplied in the Parallax Documentation, I'm wondering if we're even talking about the same sensor! A quick glance at the code below will show you what I mean. Even if you're using three sensors (left, center, right), as·might well·be implied by your coding, there is something RADICALLY wrong here.

    Parallax Supplied Test·Program for QTI Line Sensor
    As supplied in the QTI Line Sensor Revision One PDF Document

    /code

    '
    [noparse][[/noparse] Title ]
    ' Mini-Sumo 3.1 : Line Sensor Test

    ' {$STAMP BS2}

    '
    [noparse][[/noparse] I/O Definitions ]
    LineSnsrPwr CON 10············ ' line sensor power
    LineSnsrIn CON 9················ ' line sensor input

    '
    [noparse][[/noparse] Constants ]
    ClrEOL CON 11···················· ' clear to end of line (DEBUG)

    '
    [noparse][[/noparse] Variables ]
    Sense VAR Word·················· ' sensor raw reading

    '
    [noparse][[/noparse] Main Code ]
    Read_Sensor:

    HIGH LineSnsrPwr················ ·' activate sensor
    HIGH LineSnsrIn················· · ' discharge QTI cap

    PAUSE 1

    RCTIME LineSnsrIn, 1, Sense·· ' read sensor value
    LOW LineSnsrPwr················· ' deactivate sensor

    Display:

    DEBUG Home DEBUG "Sensor ", CR DEBUG "
    ", CR DEBUG DEC Sense, ClrEOL
    PAUSE 100
    GOTO Read_Sensor

    END

    code/

    Regards,

    Bruce Bates
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-01-08 14:45
    Spencer -

    I just found the sample code from which your example came. I'm now as puzzled as you are. Apparently the coding in the document I had used was for "analog sampling" or something like that. Sorry for any confusion my prior post may have caused!

    May I presume all your sense wires (RED) are tied in common with each other?

    Regards,

    Bruce Bates
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-08 15:26
    Post removed by Jon Williams -- error on my part.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax

    Post Edited (Jon Williams (Parallax)) : 1/8/2006 5:18:43 PM GMT
  • SpencerSpencer Posts: 17
    edited 2006-01-08 16:35
    Jon,

    Unless there is a problem with the test code supplied with the QTI line follower appkit, pin 0 is the only pin I am supposed to be sampling. All the sensors are
    tied to that pin.

    Bruce,

    I have checked and double checked and even had outside parties check the wiring. The next thing I am going to try is testing the circuit on a different breadboard.
    It is an old breadboard that I pulled out of a drawer and may have some faults in it.

    Post Edited (Spencer) : 1/8/2006 4:40:06 PM GMT
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-08 17:18
    Sorry, my mistake -- will remove error (that teach me for not looking at our docs!).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.