Download Print this page

Parallax 555-27401 Manual page 6

Qti sensor kickstart

Advertisement

}
long RCTime(int sensorIn){
long duration = 0;
pinMode(sensorIn, OUTPUT);
digitalWrite(sensorIn, HIGH);
delay(1);
pinMode(sensorIn, INPUT);
digitalWrite(sensorIn, LOW);
while(digitalRead(sensorIn)){
duration++;
}
return duration;
}
Note: To view the results of the demonstration, after uploading is complete click the Serial
Monitor icon in the Arduino IDE. This displays the Serial Monitor window. Momentarily
depress the Reset button on the Arduino board to restart the sketch.
Note: Depending on surface reflectivity, values will range from about 40 to 1300.
For More Information
Visit the full documentation for the
The
QTI Line Follower AppKit (#28108)
attach to the BOE-Bot robot chassis, and is specifically designed to provide line following
capability.
The
Infrared Line Follower Kit (#28304)
and is also designed to provide line following capability to the BOE-Bot robot chassis.
Copyright © Parallax Inc.
// Make pin OUTPUT
// Pin HIGH (discharge capacitor)
// Wait 1ms
// Make pin INPUT
// Turn off internal pullups
// Wait for pin to go LOW
QTI Sensor
(#555-27401), available from its product page.
contains four QTI sensors, plus mounting hardware to
is a single module with eight integrated infrared sensors,
Page 6 of 6

Advertisement

loading