ECRobot C++ API for LEGO MINDSTORMS NXT
1.0.10
|
00001 // 00002 // AccelSensor.h 00003 // 00004 // Copyright 2009 by Takashi Chikamasa, Jon C. Martin and Robert W. Kramer 00005 // 00006 00007 #ifndef ACCELSENSOR_H_ 00008 #define ACCELSENSOR_H_ 00009 00010 #include "I2c.h" 00011 00012 00013 namespace ecrobot 00014 { 00053 class AccelSensor 00054 { 00055 public: 00065 explicit AccelSensor(ePortS port); 00066 00074 void getAccel(S16 axes[3]) const; 00075 00088 inline void get(U8 data[6]) const { mI2c.receive(0x42, data, 6); } 00089 00090 private: 00091 I2c mI2c; // composite 00092 }; 00093 } 00094 #endif