1 /* sample.cpp for TOPPERS/ATK(OSEK) */
\r
4 #include "LightSensor.h"
\r
5 #include "SonarSensor.h"
\r
6 #include "SoundSensor.h"
\r
7 #include "TouchSensor.h"
\r
10 using namespace ecrobot;
\r
15 #include "kernel_id.h"
\r
16 #include "ecrobot_interface.h"
\r
18 LightSensor light(PORT_1, false /* lamp off */);
\r
19 SonarSensor sonar(PORT_2);
\r
20 SoundSensor mic(PORT_3);
\r
21 TouchSensor touch(PORT_4);
\r
23 /* nxtOSEK hook to be invoked from an ISR in category 2 */
\r
24 void user_1ms_isr_type2(void)
\r
26 SleeperMonitor(); // needed for I2C device and Clock classes
\r
37 lcd.putf("sn", "NXT Sensors");
\r
38 lcd.putf("sddn", "1/2: ", light.getBrightness(),0, sonar.getDistance(),5);
\r
39 lcd.putf("sdd", "3/4: ", mic.getLevel(),0, touch.isPressed(),5);
\r