![Parallax Boe-Bot Скачать руководство пользователя страница 57](http://html1.mh-extra.com/html/parallax/boe-bot/boe-bot_assembly_3661677057.webp)
Chapter 5: Basic Competition Code · Page 47
temp VAR Byte
' -----[ EEPROM Data ]-----------------------------------------------------
RunStatus DATA $00 ' run status
' -----[ Initialization ]--------------------------------------------------
Reset:
READ RunStatus, temp ' read current status
temp = ~temp ' invert status
WRITE RunStatus, temp ' save for next reset
IF (temp > 0) THEN END ' okay to run?
' Sets black threshold to 1/4 the average of the two sensor readings.
' SumoBot must be placed over black playing surface before this code runs.
Set_Threshold: ' set QTI black threshold
GOSUB Read_Line_Sensors
blackThresh = (lLine / 10) + (rLine / 10)
LOW LMotor ' make more pins outputs
LOW RMotor
Start_Delay: ' five second delay
FOR temp = 1 TO 5
HIGH StartLED ' show active
PAUSE 900
INPUT StartLED ' blink each second
FREQOUT Speaker, 100, 2500, 3000 ' beep each second
NEXT
GOTO Lunge ' start aggressive!
' -----[ Program Code ]----------------------------------------------------
Main:
GOSUB Read_Line_Sensors
' If not on the Shikiri line (border), continue to look for opponent,
' otherwise, spin back toward center and resume search
BRANCH lineBits, [Search_For_Opponent, Spin_Left, Spin_Right, About_Face]
' --[ Border Avoidance ]--
Spin_Left: ' right sensor was active
FOR pulses = 1 TO 20
PULSOUT LMotor, LRevFast
PULSOUT RMotor, RFwdFast
PAUSE 20
Содержание Boe-Bot
Страница 1: ...SumoBot Mini Sumo Robotics Assembly Documentation and Programming VERSION 2 1...
Страница 4: ......
Страница 9: ...Preface Page ix...
Страница 10: ......
Страница 20: ......
Страница 32: ......
Страница 54: ......
Страница 74: ......
Страница 76: ......
Страница 77: ...Appendix D SumoBot PCB Schematic Page 67 Appendix D SumoBot PCB Schematic...