'------------------------------------------------------------------ 'getver.bs2 Arrick Robotics www.robotics.com ' 'This program reads the coprocessor's version number 'and causes the beeper to beep accordingly. 'Here is an example version number: 1.2 'In this case you will hear a single high-pitched beep 'indicating the number to the left of the decimal point, 'a single low-pitched beep indicating the decimal point, 'then 2 high-pitched beeps indicating the number to the 'right of the decimal point. 'If the number right of the decimal point is 0 then 'no beeps will be given. 'Additionally, the version is sent to the serial port 'for display. '------------------------------------------------------------------ net con 8 'coprocessor network pin. baud con 396 'coprocessor network baud rate. speaker con 9 'speaker pin. ldp var byte 'left of decimal point. rdp var byte 'right of decimal point. i var byte 'beep counter. Start: low speaker 'Speaker off. pause 500 serout net,baud,["!1G"] 'Get version from co. serin net,baud,[hex2 ldp, hex2 rdp] 'Display results. serout 16,84,["Coprocessor version: ",dec ldp, ".", dec rdp, 13] for i=1 to ldp 'Left of decimal point. gosub hp next pause 300 gosub lp 'Decimal point. pause 300 if rdp=0 then zero 'Right of decimal point. for i=1 to rdp gosub hp next zero: pause 2000 goto start '------------------------------------------------------------------ 'high pitched beep. ' hp: freqout speaker,150,2000 pause 150 return '------------------------------------------------------------------ 'low pitched beep. ' lp: freqout speaker,400,600 return '------------------------------------------------------------------ 'End of program. '------------------------------------------------------------------