Parallax 29115 Скачать руководство пользователя страница 5

 

Page 4

 

The comparator will output will be high (1) or low (0), depending on which of the two input pins has the 
higher voltage.  If the minus input (voltage from IR detector) is higher than the plus input, the 

comparator output will go low.  If the plus input (threshold pot) is higher than the minus input, then the 
output will go high.  The purpose of the threshold potentiometer is to allow you to adjust for course 

reflectivity and ambient lighting conditions. 
 
When a detector “sees” a highly reflective surface, the current flow through the transistor is high so the 

voltage goes low.  If it falls below the threshold pot setting, the comparator will output a low (0).  If the 
detector is over a surface that absorbs the IR light from the LED, the current through the transistor will 

be low, causing detector output voltage to increase.  If the output voltage goes higher than the threshold 
pot setting, the comparator will output a high (1). 

 
In review, reflective surfaces will cause the Line Follower module to output a low (0); non-reflective 
surfaces will output a high (1).  We can modify this behavior with PBASIC code to suit the type of “track” 

 

 

Important Note

: The IR LEDs are under direct control of the BASIC Stamp.  It is the programmer’s 

responsibility to ensure that only one LED is lit at a time.  Allowing multiple LEDs to light will cause 
inaccurate and unpredictable results.  Figure 4 shows the connections between the BASIC Stamp and the  

Line Follower module. 

 

Figure 4: Line Follower Module Connections to the BASIC Stamp 

 

LF Function 

Stamp Pin 

Direction 

Outer Right LED 

P2 

Output 

Inner Right LED 

P3 

Output 

Center LED 

P4 

Output 

Inner Left LED 

P5 

Output 

Outer Left LED 

P6 

Output 

Line Detect 

P9 

Input 

 

Содержание 29115

Страница 1: ...The content and copyrights of the attached material are the property of its owner Distributed by www Jameco com 1 800 831 4242...

Страница 2: ...ke us and line following circuitry will help get us there safely and without effort With the Parallax Line Follower module you can experiment with this technology today using your BOE Bot Features The...

Страница 3: ...sis Use the other two 4 40 screws to secure the Line Follower Module to the BOE Bot 9 Holding the BOE Bot in your hand turn it over so the bottom side faces up Hold the ribbon cable in your other hand...

Страница 4: ...nd that the IR Detect output is taken at collector of the transistor As the current flow through the transistor increases the voltage across the 10 k resistor also increases causing the voltage at the...

Страница 5: ...hrough the transistor will be low causing detector output voltage to increase If the output voltage goes higher than the threshold pot setting the comparator will output a high 1 In review reflective...

Страница 6: ...back and forth across this line and see the corresponding detector bit change on the DEBUG screen Be careful not to lift the BOE Bot off the paper The emitter detector pairs are focused devices and th...

Страница 7: ...turn the correct value for the specified course type The final constant value is called MoveTo and has a value of 2 This is a little used yet very useful code to use with DEBUG MoveTo allows the curso...

Страница 8: ...at this does is allow the program to see the line be it black on white or white on black as a 1 If no line is detected the output bit will be zero After each bit is recorded the LEDs are switched off...

Страница 9: ...O Definitions Constants LEDon CON 0 LF LEDs are active low LEDoff CON 1 WLine CON 0 white line on black field BLine CON 1 black line on white field LFmode CON BLine set pgm for black line MoveTo CON...

Страница 10: ...eTo 4 3 BIN5 lfBits display LF reading GOTO Main END Subroutines Read_Line_Follower lfBits 0 clear last reading FOR ledPos 2 TO 6 OutL LowBit ledPos LEDon turn the LED on PAUSE 1 allow sensor to read...

Страница 11: ...ialized to 00100 This will cause the BOE Bot to go straight even if it is started off the line The function of the main loop is to read the Line Follower module and decode its bits determining the app...

Страница 12: ...lement Revision History 01 DEC 2001 Version 1 0 I O Definitions LMotor CON 15 servo motor connections RMotor CON 14 Constants LEDon CON 0 LF LEDs are active low LEDoff CON 1 WLine CON 0 white line on...

Страница 13: ...o read lfBits LowBit ledPos In9 LFmode record the sensor reading OutL OutL 01111100 turn LEDs off NEXT lfBits lfBits 2 shift bits to zero index RETURN Off_Line lfBits lastBits get last known position...

Страница 14: ...Parallax Inc Parallax Line Follower 29115 12 2001 Page 13 Hard_Left PULSOUT LMotor MStop stop left motor PULSOUT RMotor MStop Speed075 GOTO Save_Last Notes...

Страница 15: ...power state The next time the Stamp is reset by pressing the Reset button the reset flag value is read and inverted again This time the inverted value will be FF and the program will proceed to initia...

Страница 16: ...History 01 DEC 2001 Version 1 0 I O Definitions LMotor CON 15 servo motor connections RMotor CON 14 Constants LEDon CON 0 LF LEDs are active low LEDoff CON 1 WLine CON 0 white line on black field BLi...

Страница 17: ...n the course Check_End IF lfBits 11111 THEN Steer_Robot keep steering if not at end IF onCourse No THEN Straight still at start IF lastBits 00000 THEN At_End verify end of course Steer_Robot steer NCD...

Страница 18: ...r GOTO Save_Last Right PULSOUT LMotor MStop Speed100 full speed on left PULSOUT RMotor MStop GOTO Save_Last Straight PULSOUT LMotor MStop Speed100 both motors forward PULSOUT RMotor MStop Speed100 GOT...

Страница 19: ...k photographers backdrop paper It may be necessary to make cuts in the tape on the insides of sharp corners Be sure to burnish the tape down flush so that it doesn t interfere with the sensor array Fi...

Отзывы: