1 /* sample.cpp for TOPPERS/ATK(OSEK) */
\r
8 #include "GamePad.h" // GamePad class for NXT GamePad
\r
9 #include "Bluetooth.h"
\r
10 #include "BTConnection.h"
\r
11 using namespace ecrobot;
\r
15 static const CHAR* PASSKEY = "1234";
\r
20 #include "kernel_id.h"
\r
21 #include "ecrobot_interface.h"
\r
23 /* nxtOSEK hook to be invoked from an ISR in category 2 */
\r
24 void user_1ms_isr_type2(void){}
\r
31 BTConnection btConnection(bt, lcd, nxt);
\r
33 if (btConnection.connect(PASSKEY) == 1)
\r
36 VectorT<S8> command;
\r
38 lcd.putf("s", "GamePad");
\r
41 command = gp.get(); // receive command from GamePad
\r
42 lcd.clearRow(1); // clear data buffer at row 1
\r
43 lcd.putf("dd", command.mX,0, command.mY,5);
\r