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

QTI

Ken SwinneyKen Swinney Posts: 12
edited 2008-05-13 22:15 in General Discussion
I have "QTI Line follwoer AppKit for the Boe-Bot (#28108)" that we have used with success in several projects built around the Basic Stamp. We are working on a bot built around the Javelin, but are unable to get the qti to change states with the Javelin.

We are using the "Borad of educaiton" with the Javelin plugged in. We have run the "ButtonLed" sample program and it worked fine. Then built the qti circuit on the board and ran the program below. P3 always shows false no matter what the qti sees.

Any help would be appreciated.

import stamp.core.*;
public class qti{
· final static char CLS = '\u0010';
· final static int left=CPU.pin5;
· final static int center=CPU.pin6;
· final static int right=CPU.pin7;
· final static int P3=CPU.pin3;
· static boolean Left;
· static boolean Center;
· static boolean Right;
· final static boolean high=true;
· final static boolean low=false;
· public static void main(){
· CPU.writePin(left,low);
· CPU.writePin(center,low);
· CPU.writePin(right,low);
··· while (true){
····· CPU.writePin(left,high);
····· CPU.delay(10);
····· Left=CPU.readPin(P3);
····· System.out.print(Left);
····· CPU.writePin(left,low);
//····· CPU.writePin(center,high);
//····· CPU.delay(10);
//····· Center=CPU.readPin(P3);
//····· CPU.writePin(center,low);
//····· CPU.writePin(right,high);
//····· CPU.delay(10);
//····· Right=CPU.readPin(P3);
//····· CPU.writePin(right,low);
//····· System.out.print(CLS);
//····· System.out.println("left· ");
//····· System.out.print(Left);
//····· System.out.println(" ");
//····· System.out.println("Center· ");
//····· System.out.print(Center);
····· CPU.delay(10000);
··· }
· }
}


Ken Swinney
Bevill State CC

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-05-13 13:21
    Which circuit did you built?
    I found the folllowing test program in the JBot package.

    import stamp.core.*;

    /**
    ·* QTI with cap test
    ·*
    ·* @version 1.0 3/9/03
    ·* @author Bill Wong
    ·*/

    public class QtiTest1 {
    · public static void main() {
    //··· PWM pwm = new PWM (CPU.pin2,1,2) ;

    ··· while(true) {
    ····· CPU.writePin(CPU.pin1,true);
    ····· CPU.delay(1);
    //····· System.out.println(CPU.readPin(CPU.pin1));
    ····· System.out.println(CPU.rcTime(9,CPU.pin1,false));
    ··· }
    · }
    }

    regards peter
  • Ken SwinneyKen Swinney Posts: 12
    edited 2008-05-13 13:32
    Can you get to the document that comes with the QTI kit? The circuit is pictured there, or I can scan and post.
    Ken
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-05-13 14:22
  • Ken SwinneyKen Swinney Posts: 12
    edited 2008-05-13 14:24
    Page 4. Trying to test qti on pin 5
    Ken
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2008-05-13 14:35
    Try this:

    import stamp.core.*;
    public class qti{
    · final static int right=CPU.pin5;
    · final static int P3=CPU.pin3;
    · static boolean Right;
    · final static boolean high=true;
    · final static boolean low=false;
    · public static void main(){
    · CPU.writePin(right,low);
    ··· while (true){
    ····· CPU.writePin(right,high);
    ····· CPU.delay(10);
    ····· Right=CPU.readPin(P3);
    ····· System.out.println(Right);
    ····· CPU.writePin(right,low);
    ····· CPU.delay(10000);
    ··· }
    · }
    }

    This is your program, I only named pin5 right as in the docs.
    If it does not work (eg. you don't get false/true text in messagewindow)
    try another pin combination. Perhaps pin5 or pin3 is faulty.
    Are you sure the QTI is not defected?

    regards peter
  • Ken SwinneyKen Swinney Posts: 12
    edited 2008-05-13 14:50
    Tried it, but no success.

    I know it is not the qti's because I can replace the Javelin with the Basic Stamp and it follows the line!!!
    I have it output and can watch PIN3 change states.

    I am really perplexed. Are there any other postings about using the qti with the Javelin?
    I even set up the buottonled program and circuit on page 26 of the Javelin Stamp Users Manual (version 1.0). I even changed the circuit and program to use pins 3 and 5 and it works. According to the qti circuit diagram there is a 220 ohm resistor in series with the Red wire connector, so I added a 220 ohm to the circuit above and it still works!!!

    Ken
  • Ken SwinneyKen Swinney Posts: 12
    edited 2008-05-13 22:15
    the solution was to change the value of the pull up resistor down from 10k. IT turns out that with the 10k resistor, pin3 was only see around 1.4-6 volts. Dropping the value to 4.7k allowed pin3 to see about 2.5 volts which is enough to read true.
    Thanks for the help.
    Ken
Sign In or Register to comment.