;*********************************************************** ;* ;* BasicBumpBot.asm - V2.0 ;* ;* This program contains the neccessary code to enable the ;* the TekBot to behave in the traditional BumpBot fashion. ;* It is written to work with the latest TekBots platform. ;* If you have an earlier version you may need to modify ;* your code appropriately. ;* ;* The behavior is very simple. Get the TekBot moving ;* forward and poll for whisker inputs. If the right ;* whisker is activated, the TekBot backs up for a second, ;* turns left for a second, and then moves forward again. ;* If the left whisker is activated, the TekBot backs up ;* for a second, turns right for a second, and then ;* continues forward. ;* ;*********************************************************** ;* ;* Author: David Zier and Mohammed Sinky (modification Jan 8, 2009) ;* Date: January 8, 2009 ;* Company: TekBots(TM), Oregon State University - EECS ;* Version: 2.0 ;* ;*********************************************************** ;* Rev Date Name Description ;*---------------------------------------------------------- ;* - 3/29/02 Zier Initial Creation of Version 1.0 ;* - 1/08/09 Sinky Version 2.0 modifictions ;* ;*********************************************************** .include "m128def.inc" ; Include definition file ;************************************************************ ;* Variable and Constant Declarations ;************************************************************ .def mpr = r16 ; Multi-Purpose Register .def waitcnt = r17 ; Wait Loop Counter .def ilcnt = r18 ; Inner Loop Counter .def olcnt = r19 ; Outer Loop Counter .equ WTime = 100 ; Time to wait in wait loop, used to be 100 .equ RWTime = 200 ; Time to wait in wait loop, used to be 100 .equ WskrR = 0 ; Right Whisker Input Bit .equ WskrL = 1 ; Left Whisker Input Bit .equ EngEnR = 4 ; Right Engine Enable Bit .equ EngEnL = 7 ; Left Engine Enable Bit .equ EngDirR = 5 ; Right Engine Direction Bit .equ EngDirL = 6 ; Left Engine Direction Bit ;///////////////////////////////////////////////////////////// ;These macros are the values to make the TekBot Move. ;///////////////////////////////////////////////////////////// .equ MovFwd = (1<