NXC  Version 1.2.1 r5
 All Data Structures Files Functions Variables Groups Pages
ex_DataMode.nxc

This is an example of how to use the HSDataMode, BTDataMode, SetHSDataMode, SetBTDataMode, TextOut, and Wait functions.

task main()
{
string DataModeNames[3] = {"NXT", "GPS", "RAW"};
byte dm;
// hi-speed data mode
dm = HSDataMode();
TextOut( 0, LCD_LINE1, "HSDataMode: ");
TextOut(80, LCD_LINE1, DataModeNames[dm]);
// bluetooth data mode
dm = BTDataMode();
TextOut( 0, LCD_LINE2, "BTDataMode: ");
TextOut(80, LCD_LINE2, DataModeNames[dm]);
// change hi-speed port to NXT mode
// change Bluetooth to GPS mode
dm = HSDataMode();
TextOut( 0, LCD_LINE4, "HSDataMode: ");
TextOut(80, LCD_LINE4, DataModeNames[dm]);
dm = BTDataMode();
TextOut( 0, LCD_LINE5, "BTDataMode: ");
TextOut(80, LCD_LINE5, DataModeNames[dm]);
}