For Sharp GP2Y0E03(optical distance measurement sensor).

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MjGP2Y0E03.h Source File

MjGP2Y0E03.h

00001 #ifndef MJ_GP2Y0E03_H
00002 #define MJ_GP2Y0E03_H
00003 
00004 #include "mbed.h"
00005 
00006 namespace matsujirushi {
00007 
00008 class MjGP2Y0E03
00009 {
00010 public:
00011     MjGP2Y0E03(I2C* i2c, uint8_t address);
00012     uint16_t getDistance();
00013     bool getImageSensorData(uint32_t *data, size_t dataSize, size_t *dataSizeActual);
00014     
00015 private:
00016     I2C *i2c;
00017     uint8_t address;
00018 
00019     void read(uint8_t regAddress, uint8_t *data, size_t dataSize);
00020     void write(uint8_t regAddress, uint8_t data);
00021     
00022 };
00023 
00024 } // namespace matsujirushi
00025 
00026 #endif