X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=nxtOSEK%2Fecrobot%2Fc%2B%2B%2Fhtml%2Fclassecrobot_1_1_compass_sensor.html;fp=nxtOSEK%2Fecrobot%2Fc%2B%2B%2Fhtml%2Fclassecrobot_1_1_compass_sensor.html;h=ee9b177c56f5c117ad9305f1b90e2c01edfedca8;hb=e81c1a1ebc8b70643a4d919834db16699bf28a3a;hp=0000000000000000000000000000000000000000;hpb=8d9be45716cdcc96fb413e0efaf644d0919976e5;p=nxt-jsp%2Fetrobo-atk.git diff --git a/nxtOSEK/ecrobot/c++/html/classecrobot_1_1_compass_sensor.html b/nxtOSEK/ecrobot/c++/html/classecrobot_1_1_compass_sensor.html new file mode 100644 index 0000000..ee9b177 --- /dev/null +++ b/nxtOSEK/ecrobot/c++/html/classecrobot_1_1_compass_sensor.html @@ -0,0 +1,244 @@ + + + + +ECRobot C++ API for LEGO MINDSTORMS NXT: ecrobot::CompassSensor Class Reference + + + + + + +
+

ecrobot::CompassSensor Class Reference

+

HiTechnic Compass sensor (http://www.hitechnic.com/) class. +More...

+ +

#include <CompassSensor.h>

+ +

List of all members.

+ + + + + + + + + + + + +

Public Member Functions

 CompassSensor (ePortS port)
 Constructor (activate I2C).
S16 getHeading (void) const
 Get heading data.
void get (U8 data[5]) const
 Get raw I2C data.
void beginCalibration (void)
 Start sensor calibration.
bool endCalibration (void)
 End sensor calibration.
+

Detailed Description

+

HiTechnic Compass sensor (http://www.hitechnic.com/) class.

+

[ How to use with TOPPERS/ATK1(OSEK) ]
+ I2C (derived/compositted) class and Clock class internally use RTOS features. Thus, user needs to implement a C function and RTOS provided events.
+
+ + Invoke SleeperMonitor function in user_1msec_isr_type2 hook.
+   void user_1ms_isr_type2(void)
+   {
+     SleeperMonitor(); // needed for I2C devices and Clock class
+   }
+
+ + Define EventSleepI2C and EventSleep Events in user oil file.
+   EVENT EventSleepI2C
+   {
+     MASK = AUTO;
+   };
+
+   EVENT EventSleep
+   {
+     MASK = AUTO;
+   };
+
+   TASK TaskMain
+   {
+     AUTOSTART = TRUE
+     {
+       APPMODE = appmode1;
+     };
+     PRIORITY = 1;
+     ACTIVATION = 1;
+     SCHEDULE = FULL;
+     STACKSIZE = 512;
+     EVENT = EventSleepI2C; <- Here it is
+     EVENT = EventSleep; <- Here it is
+   };
+
+ [ How to use with TOPPERS/JSP(ITRON) ]
+ In case of using this class with TOPPERS/JSP(ITRON), RTOS specific definitions for the class are not needed.

+

Constructor & Destructor Documentation

+ +
+
+ + + + + + + + + +
ecrobot::CompassSensor::CompassSensor (ePortS  port )  [explicit]
+
+
+ +

Constructor (activate I2C).

+

Note:
+ This class must be constructed as a global object. Otherwise, a device assertion will be displayed
+ in the LCD when the object is constructed as a non global object.
+ When the object is destructed while the system is shut down, the device is de-activated automatically.

+
Parameters:
+ + +
port Compass sensor connected port
+
+
+
Returns:
-
+ +
+
+

Member Function Documentation

+ +
+
+ + + + + + + + + +
void ecrobot::CompassSensor::beginCalibration (void  ) 
+
+
+ +

Start sensor calibration.

+
Parameters:
+ + +
- 
+
+
+
Returns:
-
+ +
+
+ +
+
+ + + + + + + + + +
bool ecrobot::CompassSensor::endCalibration (void  ) 
+
+
+ +

End sensor calibration.

+
Parameters:
+ + +
- 
+
+
+
Returns:
true: calibration was successful
+ false: calibration was failed
+ +
+
+ +
+
+ + + + + + + + + +
void ecrobot::CompassSensor::get (U8  data[5] )  const [inline]
+
+
+ +

Get raw I2C data.

+
Parameters:
+ + +
data Data representation from the sensor, per Hi-Technic's documentation:
+ data[0]: mode control
+ data[1]: heading upper 8 bits
+ data[2]: heading lower 1 bit
+ data[3]: heading lower 8 bits
+ data[4]: heading upper 1 bit
+
+
+
Returns:
-
+ +
+
+ +
+
+ + + + + + + + + +
S16 ecrobot::CompassSensor::getHeading (void  )  const
+
+
+ +

Get heading data.

+
Parameters:
+ + +
- 
+
+
+
Returns:
Heading data
+ +
+
+
The documentation for this class was generated from the following file: +
+
Generated on Tue Dec 29 11:38:02 2009 for ECRobot C++ API for LEGO MINDSTORMS NXT by  + +doxygen 1.6.1
+ +