GPS with RobotC
software/
NXT Repository/Programming/
NXT Repository/Tutorials/

Dick Swan, the developer of RobotC, sent me a sample code for using a BT GPS with NXT using RobotC. The code can be downloaded here. As one can see in the image, it displays time, position and other data on the NXT LCD display. This code requires a RobotC version which is still not public, which can be rechived directly from Dick Swan (dickswan at sbcglobal dot net).
How easy is it doing GPS communcation with RobotC? Well - very easy. You first turn the BT to ‘Raw Mode’ by setBluetoothRawDataMode() command. Then you simply read data (say one char) from the BT like a regular serial port with nxtReadRawBluetooth(BytesRead[0], 1). The rest of the code is GPS specific message parsing etc.
I was also astonished how easy is it to connect BT device programatically in RobotC. The three lines at the end of the code:
setSessionPIN(”1234″);
bBTSkipPswdPrompt = true;
btConnect(2, kGPSName);
Is all you need! It defines the PIN code to use, tell the NXT not to show password dialog and connect to a preset device (given by a const string kGPSName).