4 // Test of C++ and LEJOS-OSEK
\r
6 // Written 9-jan-2008 by rwk
\r
8 // Copyright 2007, 2008 by Takashi Chikamasa and Robert W. Kramer
\r
11 #include <CompassSensor.h>
\r
12 #include <SonarSensor.h>
\r
15 // To properly interface with LEJOS-OSEK, we need to use C linkage between our
\r
16 // code and LEJOS-OSEK
\r
21 #include "ecrobot_interface.h"
\r
23 CompassSensor comp(NXT_PORT_S2);
\r
24 SonarSensor sonar(NXT_PORT_S1);
\r
27 // Main task (thread) declarations
\r
29 // You need one DeclareTask( ) per task/thread
\r
35 // OSEK callback hooks. Often unused, but must exist for proper linkage
\r
38 void StartupHook(void){
\r
44 void ShutdownHook(StatusType ercd){
\r
51 // User tasks go here.
\r
58 display_goto_xy(0,1);
\r
59 display_int(comp.getHeading(),0);
\r
61 display_goto_xy(0,3);
\r
62 display_int(sonar.getDistance(),0);
\r
69 // your task should end like this unless it's a one-shot task
\r