|
'Matthew Klarich GPS guidance program for R/C truck with Scott Edwards SSCII
Serial Servo Controller
'GPS used is a garmin etrex set to NMEA 0183 at 4800bps 'GPS is on pin 8
'Serial Servo Controller on pin 7 'order of serial inputs of GPRMB and GPRMC
may need reversed depending on GPS unit.
tr1 var word 'true heading variable
wp1 var word 'waypoint heading variable
sync con 255 'sync byte for servo controller
n24n con $418d 'this is the baudrate out to servo
controller
loop1:
' next sentence takes information from $GPRMC sentence coming from GPS unit
' set to NMEA data out.
' It is set at the standard NMEA rate of 4800 baud
serin 8, 16572, [wait("GPRMC,"),wait(","),wait(","),wait(","),wait(","),wait(","),
wait(","),wait(","),dec tr1] 'puts serin data in RAM, it is the current
true heading
serin 8, 16572, [wait("GPRMB,"),wait(","),wait(","),wait(","),wait(","),wait(","),
wait(","),wait(","),wait(","),wait(","),wait(","), dec wp1] 'puts serin
data in RAM, it is current waypoint heading
IF wp1 < tr1 THEN bearLeft
serout 7,n24n,[sync,0,177]
serout 7,n24n,[sync,1,145]
goto loop1
bearLeft:
serout 7,n24n,[sync,0,77]
serout 7,n24n,[sync,1,145]
goto loop1
|