'BII routine to drive my compass 'and Rochanda LCD board. 'DLC revision 6/17/99 Copyright Dennis Clark 1999 ' 'LED is on I/O 0 'speaker is on I/O 1 'compass is on I/O 2 'LCD board is on I/O 3 'These are for the servo routines i var byte n var byte 'These are for serial communication N2400 con 396 '2400 baud noninverted I2400 con 16780 '2400 baud inverted N9600 con 84 '9600 baud noninverted 'Make some noise, toggle the LED and wait for LCD reset completion freqout 1,200,1000 pause 500 low 0 pause 1000 high 0 serout 3,N9600,10,[$FE,$01,"TTT Compass"] pause 500 for n = 1 to 32000 output 2 'sequence to trigger the compass board high 2 pause 1 low 2 pause 1 high 2 input 2 serin 2,N2400, [i] serout 3,N9600,10,[$FE,$01,"(",DEC i,")"] branch i,[pn,pne,pe,pse,ps,psw,pw,pnw] goto nope pn: serout 3,N9600,10,["North"] goto dn pne:serout 3,N9600,10,["North East"] goto dn pe: serout 3,N9600,10,["East"] goto dn pse:serout 3,N9600,10,["South East"] goto dn ps: serout 3,N9600,10,["South"] goto dn psw:serout 3,N9600,10,["South West"] goto dn pw: serout 3,N9600,10,["West"] goto dn pnw:serout 3,N9600,10,["North West"] goto dn nope:serout 3,N9600,10,["Movement Error"] dn: 'all done next stop end