' www.crustcrawler.com ' Copyright 2006 CrustCrawler Inc. ' '------- [ HexRodBase.BS2 ] ---------------------------------------------- '{$STAMP BS2} '{$PBASIC 2.5} ' ' File....... HexRodBase.BS2 ' Purpose.... Investigate program parameters. ' Create and test custom walking gaits. ' Author..... CrustCrawler Inc. (Mike Gebhard) ' E-mail..... support@crustcrawler.com ' Started.... 11/03/2005 ' Updated.... 04/9/2006 ' Version.... 2.0 ' ' Hardware ' (1) HexRod Robotic Kit ' (1) Parallax BOE ' (1) Parallax Basic Stamp II ' (1) Parallax PSC ' (1) Parallax LCD AppMod ' '========================================================================= ' Updates '========================================================================= ' ' '========================================================================= ' Overview '========================================================================= ' Use the LCD AppMod to select gait parameters ' HexRodLCD.bs2 is a combination of HexRodBase.bs2 and GaitGUI.bs2. ' Please refer to these applications for specific program functionality. ' '========================================================================= ' Getting Started '========================================================================= ' On first load, the CrustCrawler logo is displayed on the LCD AppMod. ' After 1/2 second the Velocity menu is displayed. If the LCD is blank, ' adjust the contrast POT. ' ' Use the LCD AppMod buttons to interface with the robot's gait ' parameters. ' ' BUTTONS ' A = Mode (set speed, direction, limiter) ' B = Increment ' C = Decrement ' D = Enter ' ' Press button A to setup the walking parameters. Pressing button A will ' toggle between the speed, direction, and limiter screens. Button B ' increments the value displayed. Button C decrements the value. ' Press D to exit setup and start walking. ' '========================================================================= ' Operation '========================================================================= ' There are 3 menus as mentioned above. ' ' Speed: ' Speed options range from 0-15. Zero is the fastest speed setting. ' 15 is the slowest. ' ' Direction: ' There are 8 directions. ' 0 - Forward ' 1 - ForwardRight ' 2 - RightSpin ' 3 - BackRight ' 4 - Backward ' 5 - BackLeft ' 6 - LeftSpin ' 7 - ForwardLeft ' ' Limiter: ' Range 0-200 ' Reduces horizontal swing from each servo's center position. ' Center values where determined when you programmatically ' center the legs. ' ' NOTE: ' If the gait looks off center press the PSC's reset button. ' '========================================================================= ' Sub Routines '========================================================================= ' Please refer to HexRodBase.bs2 and GaitGUI.bs2 for details ' '========================================================================= ' Tripod Walk Forward Graphic Example: '========================================================================= ' ' **Right Side** ' F \ / \ / \ / ' O \ / \ / \ / ' R |------------------| |------------------| ' W | 1 2 3 | | 1 2 3 | ' A | 4 5 6 | | 4 5 6 | ' R |------------------| |------------------| ' D \ / \ / \ / ' \ / \ / \ / ' **Left Side** ' '------------------------------------------------------------------------- ' -----[ I/O Definitions ]------------------------------------------------ PSC PIN 15 ' PSC module ' Set baud for all STAMP versions #SELECT $STAMP #CASE BS2SX, BS2P Baud CON 1021 + $8000 #CASE BS2PX Baud CON 1646 + $8000 #CASE #ELSE Baud CON 396 + $8000 #ENDSELECT ' -----[ LCD I/O Definitions ]-------------------------------------------- E PIN 1 ' LCD Enable (1 = enabled) RW PIN 2 ' Read/Write RS PIN 3 ' Reg Select (1 = char) LcdDirs VAR DIRB ' dirs for I/O redirection LcdBusOut VAR OUTB LcdBusIn VAR INB #DEFINE _lcdReady = ($stamp = BS2SX) OR ($stamp = BS2P) LcdCls CON $01 ' clear the LCD LcdHome CON $02 ' move cursor home LcdCrsrL CON $10 ' move cursor left LcdCrsrR CON $14 ' move cursor right LcdDispL CON $18 ' shift chars left LcdDispR CON $1C ' shift chars right LcdDDRam CON $80 ' Display Data RAM control LcdCGRam CON $40 ' Character Generator RAM LcdLine1 CON $80 ' DDRAM address of line 1 LcdLine2 CON $C0 ' DDRAM address of line 2 LcdScrollTm CON 250 ' LCD scroll timing (ms) '---- [Walking Variables] ------------------------------------------------ ptrEEPROM VAR Word ' Gait select servoPosition VAR Word ' Servo Position temp VAR Word ' Workspace servoAddr VAR Byte ' Servo addresses ramp VAR Byte ' Ramp used in SEROUT vel VAR Byte ' Value from speed screen rightRamp VAR Byte ' Right side ramp values leftRamp VAR Byte ' Left side ramp values limiter VAR Byte ' Reduce stride delay VAR Byte ' Wait ' -----[ LCD Variables ]-------------------------------------------------- counter VAR Byte ' Loop counter char VAR Byte ' Character sent to LCD value VAR Byte ' Increment Decr. value dir VAR Nib ' Direction menu VAR Nib ' Current menu buttons VAR Nib btnA VAR buttons.BIT0 ' left-most button btnB VAR buttons.BIT1 btnC VAR buttons.BIT2 btnD VAR buttons.BIT3 ' right-most '-----[ Horizontal Leg Constants ]---------------------------------------- ' Adjustable leg centers ' Left Side ' Increase value to move leg forward Center1 CON 750 Center2 CON 750 Center3 CON 750 ' Right Side ' Increase value to move leg back Center4 CON 750 Center5 CON 780 Center6 CON 700 '-----[ Stride Calculations ]--------------------------------------------- ' The stride value determines the maximum value to move a horizontal ' servo from center. So a stride value of 150 means move 150 units ' plus servo center and 150 units minus servo center or 150 + 150 ' units. ' 5.5556 units = 1 degree ' a Stride of 150 = 54 degrees or ' (150*2)/5.556 Stride CON 200 Leg1Center CON Center1 Leg1Forward CON Center1+Stride ' Stride + Leg1 Center Leg1Back CON Center1-Stride Leg2Center CON Center2 Leg2Forward CON Center2+Stride Leg2Back CON Center2-Stride Leg3Center CON Center3 Leg3Forward CON Center3+Stride Leg3Back CON Center3-Stride Leg4Center CON Center4 Leg4Forward CON Center4-Stride Leg4Back CON Center4+Stride Leg5Center CON Center5 Leg5Forward CON Center5-Stride Leg5Back CON Center5+Stride Leg6Center CON Center6 Leg6Forward CON Center6-Stride Leg6Back CON Center6+Stride LiftRamp CON $1 ' Vertical servo ramp '----- [Adjustable vertical servo positions] ----------------------------- RaiseRight CON 650 ' Raised and lowered ** LowerRight CON 1200 ' vertical servo values ** RaiseLeft CON 900 LowerLeft CON 300 '----- [Direction Constants] --------------------------------------------- Ahead CON 0 ForwardRight CON 1 RightSpin CON 2 BackRight CON 3 Backward CON 4 BackLeft CON 5 LeftSpin CON 6 ForwardLeft CON 7 '----- [EEPROM DATA ] ---------------------------------------------------- EOD CON $FF 'LCD EEPROM Data 'Smiley DATA $00, $0A, $0A, $00, $11, $0E, $06, $00 ' 0 smiley DownArrow DATA $04, $04, $04, $04, $1F, $0E, $04, $00 ' 1 Down Arrow UpArrow DATA $04, $0E, $1F, $04, $04, $04, $04, $00 ' 2 Up Arrow C_Gear DATA $06, $0F, $09, $18, $18, $09, $0F, $06 ' 3 char1 C Gear Enter DATA $01, $01, $01, $05, $0D, $1F, $0C, $04 ' 4 Enter Arrow EndCG DATA EOD Msg1 DATA "Crust ",EOD Msg2 DATA " ",2,"rawler",EOD Msg3 DATA "PING))) ",EOD Msg4 DATA "RC ",EOD Direction DATA "Dir: ",EOD Speed DATA "Spd: ",EOD Limit DATA "Lim: ",EOD Distance DATA "Dist:",EOD GUI DATA "m ", 1, " ",0," ", 3, EOD ' Walk Forward Forward DATA $01,Word RaiseRight, $05,Word RaiseRight, $09,Word RaiseLeft, $02,Word Leg2Back, $06,Word Leg4Back, $0A,Word Leg6Back, $00,Word Leg1Forward,$04,Word Leg3Forward,$08,Word Leg5Forward, $01,Word LowerRight, $05,Word LowerRight, $09,Word LowerLeft, $03,Word RaiseRight, $07,Word RaiseLeft, $0B,Word RaiseLeft, $00,Word Leg1Back, $04,Word Leg3Back, $08,Word Leg5Back, $02,Word Leg2Forward,$06,Word Leg4Forward,$0A,Word Leg6Forward, $03,Word LowerRight, $07,Word LowerLeft, $0B,Word LowerLeft, EOD Back DATA $01,Word RaiseRight, $05,Word RaiseRight, $09,Word RaiseLeft, $02,Word Leg2Forward,$06,Word Leg4Forward,$0A,Word Leg6Forward, $00,Word Leg1Back, $04,Word Leg3Back, $08,Word Leg5Back, $01,Word LowerRight, $05,Word LowerRight, $09,Word LowerLeft, $03,Word RaiseRight, $07,Word RaiseLeft, $0B,Word RaiseLeft, $00,Word Leg1Forward,$04,Word Leg3Forward,$08,Word Leg5Forward, $02,Word Leg2Back, $06,Word Leg4Back, $0A,Word Leg6Back, $03,Word LowerRight, $07,Word LowerLeft, $0B,Word LowerLeft, EOD LSpin DATA $01,Word RaiseRight, $05,Word RaiseRight, $09,Word RaiseLeft, $02,Word Leg2Back, $06,Word Leg4Forward,$0A,Word Leg6Forward, $00,Word Leg1Forward,$04,Word Leg3Forward,$08,Word Leg5Back, $01,Word LowerRight, $05,Word LowerRight, $09,Word LowerLeft, $03,Word RaiseRight, $07,Word RaiseLeft, $0B,Word RaiseLeft, $00,Word Leg1Back, $04,Word Leg3Back, $08,Word Leg5Forward, $02,Word Leg2Forward,$06,Word Leg4Back, $0A,Word Leg6BAck, $03,Word LowerRight, $07,Word LowerLeft, $0B,Word LowerLeft, EOD '(Address 8, 6, and A positions are opposite of forwared gait) RSpin DATA $01,Word RaiseRight, $05,Word RaiseRight, $09,Word RaiseLeft, $02,Word Leg2Forward,$06,Word Leg4Back, $0A,Word Leg6Back, $00,Word Leg1Back, $04,Word Leg3Back, $08,Word Leg5Forward, $01,Word LowerRight, $05,Word LowerRight, $09,Word LowerLeft, $03,Word RaiseRight, $07,Word RaiseLeft, $0B,Word RaiseLeft, $00,Word Leg1Forward,$04,Word Leg3Forward,$08,Word Leg5Back, $02,Word Leg2Back, $06,Word Leg4Forward,$0A,Word Leg6Forward, $03,Word LowerRight, $07,Word LowerLeft, $0B,Word LowerLeft, EOD '(Address 2, 0, and 4 positions are opposite of forwared gait) 'Lower and Center all legs Neutral DATA $00,Word Center1, $02,Word Center2, $04,Word Center3, $06,Word Center4, $08,Word Center5, $0A,Word Center6, $01,Word LowerRight, $03,Word LowerRight, $05,Word LowerRight, $07,Word LowerLeft, $09,Word LowerLeft, $0B,Word LowerLeft, EOD '_________________________________________________________________________ ' 0 = normal mode ' 1 = debug mode #DEFINE debugMode = 0 Initialize: GOSUB Initialize_LCD ' Initialize LCD PAUSE 500 ' Wait 1/2 sec limiter = 0 ' Initialize limiter to 0 ramp = 0 ' Base ramp value dir = Ahead ' direction = forward vel = 3 ' Set vel to 3 ptrEEPROM = Neutral ' Center and lower all legs menu = 0 ' Show limiter menu GOTO Main ' Center legs '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// 'Clear Screen ' Write UI ' Loop until button D is pressed ' Increment/Decrement value ' Convert value to ASCII by adding 48 ' 'Parameters () 'Return () '///////////////////////////////////////////////////////////////////////// Menus: char = LcdCls ' Clear command GOSUB LCD_Command ' Write clear screen command GOSUB Write_GUI ' Write Graphic Interface Get_Menu: char = LcdHome ' Cursor to home position GOSUB LCD_Command IF menu = 0 THEN GOTO Speed_Menu IF menu = 2 THEN GOTO Limiter_Menu Direction_Menu: ptrEEPROM = Direction ' Point to Direction string GOSUB LCD_Put_String ' Write String PAUSE 100 ' Wait value = dir ' Input param direction GOTO Incr_Decr ' Skip Speed_Menu: ptrEEPROM = Speed ' Point to Speed string GOSUB LCD_Put_String ' Write String PAUSE 100 ' Wait value = vel ' Input param ramp GOTO Incr_Decr ' Skip Limiter_Menu: ptrEEPROM = Limit ' Point to Speed string GOSUB LCD_Put_String ' Write String PAUSE 100 ' Wait value = Limiter ' Input param ramp Incr_Decr: DO WHILE btnD = 0 ' Do while D not pressed GOSUB LCD_Get_Buttons ' Check button pressed IF btnB THEN ' B pressed? SELECT menu CASE 0 value = (value + 1) // 16 CASE 1 value = (value + 1) // 8 CASE 2 value = (value + 1) // 256 ENDSELECT ENDIF IF btnC THEN ' C Pressed SELECT menu CASE 0 value = (value + 15) // 16 CASE 1 value = (value + 7) // 8 CASE 2 value = (value + 255) // 256 ENDSELECT ENDIF IF btnA = 1 THEN menu = (menu + 1) // 3 GOTO Get_Menu ENDIF GOSUB Set_Value ' Assign ramp or direction GOSUB Write_Num PAUSE 75 ' Write number to LCD LOOP GOSUB CrustCrawler_Logo '________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Set delay ' Delay provides time for the servos to reach a position and is based ' on ramp (vel). ' This is an adjustable value. ' ' Parameters (vel) ' Return (delay) '///////////////////////////////////////////////////////////////////////// SetDelay: IF vel < 9 THEN delay = 30 ELSE delay = 10 ENDIF '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Set direction gait properties ' Set ptrEEPROM to EEPROM block ' Set left and right ramp values ' ' Parameters (dir) ' Return () '///////////////////////////////////////////////////////////////////////// Set_Direction: SELECT dir CASE Ahead ptrEEPROM = Forward GOSUB Equal CASE ForwardRight ptrEEPROM = Forward GOSUB SlowRight CASE RightSpin ptrEEPROM = RSpin GOSUB Equal CASE BackRight ptrEEPROM = Back GOSUB SlowRight CASE Backward ptrEEPROM = Back GOSUB Equal CASE BackLeft ptrEEPROM = Back GOSUB SlowLeft CASE LeftSpin ptrEEPROM = LSpin GOSUB Equal CASE ForwardLeft ptrEEPROM = Forward GOSUB SlowLeft ENDSELECT '_________________________________________________________________________ '#IF debugMode #THEN 'GOSUB Trace 'PAUSE 2000 '#ENDIF '///////////////////////////////////////////////////////////////////////// ' Main walking engine ' ' Parameters () ' Return () '///////////////////////////////////////////////////////////////////////// Main: 'Read 3 bytes from EEPROM READ ptrEEPROM, ServoAddr, servoPosition.LOWBYTE, servoPosition.HIGHBYTE DO WHILE servoAddr <> EOD 'Vertical servo are odd numbers IF (servoAddr // 2) = 1 THEN ramp = LiftRamp ELSE 'Set right side ramp (servo speed) IF (servoAddr = $00) OR (servoAddr = $02) OR (servoAddr = $04) THEN ramp = rightRamp ENDIF 'Set left side ramp IF(servoAddr = $06) OR (servoAddr = $08) OR (servoAddr = $0A) THEN ramp = leftRamp ENDIF 'Limit horizontal swing if limiter variable has a ' value greater than zero IF (limiter > 0) THEN GOSUB Limit_Stride ENDIF ENDIF GOSUB Write_PSC 'Increment pointer and get the next 3 EEPROM values ptrEEPROM = ptrEEPROM + 3 READ ptrEEPROM, ServoAddr, servoPosition.LOWBYTE, servoPosition.HIGHBYTE LOOP GOSUB LCD_Get_Buttons ' Check for button press IF btnA THEN ' Button A pressed? GOTO Menus ' Display menus ENDIF IF ptrEEPROM = Neutral +36 THEN limiter = 75 ' Set limiter GOTO Menus ' first load ELSE ptrEEPROM = ptrEEPROM - 72 ' Reset pointer ENDIF #IF debugMode #THEN GOSUB Trace #ENDIF GOTO Main 'Loop forever '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Write position commands to the PSC ' ' Parameters (ServoAddr, servoPosition, delay) ' Return Nothing '///////////////////////////////////////////////////////////////////////// Write_PSC: SEROUT PSC,Baud,["!SC",ServoAddr, Ramp,servoPosition.LOWBYTE, servoPosition.HIGHBYTE, CR] PAUSE delay RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Sets velocity, direction, and liniter values ' ' Parameters (ramp) ' Return (rightRamp, leftRamp) '///////////////////////////////////////////////////////////////////////// Set_Value: SELECT menu CASE 0 vel = value ' Assign ramp CASE 1 dir = value ' Assign direction CASE 2 limiter = value ' Assign limiter ENDSELECT RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Gets velocity, direction, and liniter values ' 'Parameters (menu) 'Return (vel, dir, limiter) '///////////////////////////////////////////////////////////////////////// Get_Value: SELECT menu CASE 0 value = vel ' Assign ramp CASE 1 value = dir ' Assign direction CASE 2 value = limiter ' Assign limiter ENDSELECT RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Equal ' 'Parameters (vel) 'Return (rightRamp, leftRamp) '///////////////////////////////////////////////////////////////////////// Equal: rightRamp = vel leftRamp = vel RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Slow right side ' 'Parameters (vel) 'Return (rightRamp, leftRamp) '///////////////////////////////////////////////////////////////////////// SlowLeft: rightRamp = vel leftRamp = vel + $5 RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Slow left side ' 'Parameters (vel) 'Return (rightRamp, leftRamp) '///////////////////////////////////////////////////////////////////////// SlowRight: rightRamp = vel + $5 leftRamp = vel RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Reduce leg travel by the value in limiter. This allows for run-time ' horizontal leg control. ' ' Parameters (ServoAddr, servoPosition) ' Return (servoPosition) '///////////////////////////////////////////////////////////////////////// Limit_Stride: 'Get joint center value and put it in temp SELECT ServoAddr CASE $00 temp = Center1 CASE $02 temp = Center2 CASE $04 temp = Center3 CASE $06 temp = Center4 CASE $08 temp = Center5 CASE $0A temp = Center6 CASE ELSE 'Do Noting ENDSELECT 'Reduce swing from center by the value in limiter IF servoPosition > temp THEN servoPosition = servoPosition - limiter ELSE servoPosition = servoPosition + limiter ENDIF RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Scan buttons ' ' Parameters () ' Return (buttons) '///////////////////////////////////////////////////////////////////////// LCD_Get_Buttons: LcdDirs = %0000 ' make LCD bus inputs buttons = %1111 ' assume all pressed FOR counter = 1 TO 10 buttons = buttons & LcdBusIn ' make sure button held PAUSE 5 ' debounce 10 x 5 ms NEXT LcdDirs = %1111 ' return bus to outputs RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Position LCD cursor ' Conver the number in value to ASCII and write to the LCD AppMod ' ' Parameters () ' Return () '///////////////////////////////////////////////////////////////////////// Write_Num: char = LcdLine1 + 5 ' Goto line 1 position 4 GOSUB LCD_Command C_ASCII: ' convert to ASCII value char = (value / 100) ' Get 100s position value = (value //100) ' Get Mod char = char + 48 ' Convert to ASCII GOSUB Write_LCD_Char ' Write value char = (value / 10) ' Get 10s position value = (value // 10) ' Get Mod char = char + 48 ' Convert to ASCII GOSUB Write_LCD_Char ' Write value char = value + 48 ' Convert to ASCII GOSUB Write_LCD_Char ' Write value GOSUB Get_Value RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Write interface screen to LCD AppMod ' ' Parameters () ' Return () '///////////////////////////////////////////////////////////////////////// Write_GUI: ' Write GUI items on line 2 char = LcdLine2 ' Goto Line 2 GOSUB LCD_Command ' LCD Command ptrEEPROM = GUI ' Write CG chars (menu items) GOSUB LCD_Put_String ' Write characters RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Read EEPROM data and write it to the LCD ' ' Parameters (ptrEEPROM) ' Return () '///////////////////////////////////////////////////////////////////////// LCD_Put_String: DO READ ptrEEPROM, char ' Read data at EEPROM address IF (char = EOD) THEN EXIT ' $FF = End of EEPROM String GOSUB Write_LCD_Char ' Write character to LCD ptrEEPROM = ptrEEPROM + 1 ' Increment EEPROM pointer LOOP RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Write LCD command/Write Character ' ' Parameters (char) ' Return () '///////////////////////////////////////////////////////////////////////// LCD_Command: ' write command to LCD #IF _LcdReady #THEN LCDCMD E, char RETURN #ELSE LOW RS GOTO Write_LCD_Char #ENDIF Write_LCD_Char: ' write character to LCD #IF _LcdReady #THEN LCDOUT E, 0, [char] #ELSE LcdBusOut = char.HIGHNIB ' output high nibble PULSOUT E, 3 ' strobe the Enable line LcdBusOut = char.LOWNIB ' output low nibble PULSOUT E, 3 HIGH RS ' return to character mode #ENDIF RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Initialize LCD ' Write custom cahracters to the LCD ' Write CrustCrawler Banner ' ' Parameters () ' Return () '///////////////////////////////////////////////////////////////////////// Initialize_LCD: #IF _LcdReady #THEN LCDCMD E, %00110000 : PAUSE 5 ' 8-bit mode LCDCMD E, %00110000 : PAUSE 0 LCDCMD E, %00110000 : PAUSE 0 LCDCMD E, %00100000 : PAUSE 0 ' 4-bit mode LCDCMD E, %00101000 : PAUSE 0 ' 2-line mode LCDCMD E, %00001100 : PAUSE 0 ' no crsr, no blink LCDCMD E, %00000110 ' inc crsr, no disp shift #ELSE NAP 5 ' let LCD self-initialize DIRL = %11111110 ' setup pins for LCD LcdBusOut = %0011 ' 8-bit mode PULSOUT E, 3 : PAUSE 5 PULSOUT E, 3 : PAUSE 0 PULSOUT E, 3 : PAUSE 0 LcdBusOut = %0010 ' 4-bit mode PULSOUT E, 3 char = %00101000 ' 2-line mode GOSUB LCD_Command char = %00001100 ' on, no crsr, no blink GOSUB LCD_Command char = %00000110 ' inc crsr, no disp shift #ENDIF ClearScreen: char = LcdCls ' Clear screen GOSUB LCD_Command Download_Chars: ' download custom chars char = LcdCGRam ' point to CG RAM GOSUB LCD_Command ' prepare to write CG data FOR counter = DownArrow TO EndCG-1 ' build custom chars READ counter, char ' get byte from EEPROM GOSUB Write_LCD_Char ' put into LCD CG RAM NEXT CrustCrawler_Logo: ' Dispaly CC logo char = LcdLine1 ' Line 1 GOSUB LCD_Command ptrEEPROM = Msg1 ' Message 1 pointer GOSUB LCD_Put_String ' Write string char = LcdLine2 ' Go to Line 2 GOSUB LCD_Command ' Write command ptrEEPROM = Msg2 ' Point to message 2 GOSUB LCD_Put_String ' Write string RETURN '_________________________________________________________________________ '///////////////////////////////////////////////////////////////////////// ' Writes variables to the debug terminal when DebugMode = 1 ' ' Copy and paste the Debug tool to strategic location in the code. This ' allow you to see what is in each variable in the Trace sub. '///////////////////////////////////////////////////////////////////////// 'DEBUG Tool #IF debugMode #THEN GOSUB Trace #ENDIF ' Write trace information ' to debug terminal #IF debugMode #THEN Trace: DEBUG CLS, "Buttons: ", BIN buttons, CR, ?ramp, ?leftramp, ?rightramp, ?dir, ?vel, ?menu, ?limiter, ?ptrEEPROM RETURN #ENDIF '_________________________________________________________________________