+++ /dev/null
-/* sample.cpp for TOPPERS/ATK(OSEK) */\r
-\r
-// ECRobot++ API\r
-#include "Clock.h"\r
-#include "Lcd.h"\r
-#include "Nxt.h"\r
-#include "Vector.h"\r
-#include "GamePad.h" // GamePad class for NXT GamePad\r
-#include "Bluetooth.h"\r
-#include "BTConnection.h"\r
-using namespace ecrobot;\r
-\r
-Bluetooth bt;\r
-\r
-static const CHAR* PASSKEY = "1234";\r
-\r
-extern "C"\r
-{\r
-#include "kernel.h"\r
-#include "kernel_id.h"\r
-#include "ecrobot_interface.h"\r
-\r
-/* nxtOSEK hook to be invoked from an ISR in category 2 */\r
-void user_1ms_isr_type2(void){}\r
-\r
-TASK(TaskMain)\r
-{\r
- Clock clock;\r
- Lcd lcd;\r
- Nxt nxt;\r
- BTConnection btConnection(bt, lcd, nxt);\r
-\r
- if (btConnection.connect(PASSKEY) == 1)\r
- {\r
- GamePad gp(bt);\r
- VectorT<S8> command;\r
- lcd.clear();\r
- lcd.putf("s", "GamePad");\r
- while(1)\r
- {\r
- command = gp.get(); // receive command from GamePad\r
- lcd.clearRow(1); // clear data buffer at row 1\r
- lcd.putf("dd", command.mX,0, command.mY,5);\r
- lcd.disp();\r
-\r
- clock.wait(50);\r
- }\r
- }\r
- while(1);\r
-}\r
-}\r