QTI
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
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
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
http://www.parallax.com/Store/Microcontrollers/BASICStampModules/tabid/134/txtSearch/28108/List/1/ProductID/77/Default.aspx?SortField=ProductName%2cProductName
And here is the AppKit documentation.
http://www.parallax.com/Portals/0/Downloads/docs/prod/robo/28108-QTILineFollower-v1.1.pdf
Just tell what circuit you use from the above link (pagenumber, figure).
regards peter
Ken
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
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
Thanks for the help.
Ken