'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' TAB Electronics Build Your Own Robot Kit BX24 Behavior 1 (Random) ' by Dr. J (Juliano@csuChico.edu) ' and Matt Bauer (MBauer1@csuChico.edu) ' California State University, Chico ' Intelligent Systems Laboratory ' Chico, CA 95929-0410 ' http://isl.ecst.csuchico.edu ' October 2004 ' ' BX24 version of Myke Predko's Behavior1 (Random) in PBasic. This version ' requires the BX24_byork Interface Module distributed by Chico State's ISL. ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Attribute VB_Name = "RandomNav" Option Explicit '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Public Sub RandomNav() Dim RandByte As Byte Call SetSerialPins( SC , SD ) Call InitSerialPins() Call RobotSend( RobotStop ) ' Wait for Robot to get setup Call Sleep( Delay ) ' Flash LED once Call BlinkLED( 1 ) Do RandByte = Random(NumChoices) Select Case (RandByte) Case 1 Call Navigate( RobotForward , RobotPWM3 ) Case 2 Call Navigate( RobotRight , RobotPWM3 ) Case 3 Call Navigate( RobotLeft , RobotPWM3 ) Case Else Call Navigate( RobotStop , RobotPWM0 ) End Select Loop End Sub 'RandomNav() ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''