![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
my new gear...
sensor/lidar_lite.h@22:394337a4205a, 22 months ago (annotated)
- Committer:
- yootee
- Date:
- Sat Oct 15 07:52:25 2022 +0000
- Revision:
- 22:394337a4205a
- Parent:
- 3:a9b4b2565a23
upgrade
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yootee | 3:a9b4b2565a23 | 1 | #ifndef LIDARLite_h |
yootee | 3:a9b4b2565a23 | 2 | #define LIDARLite_h |
yootee | 3:a9b4b2565a23 | 3 | |
yootee | 3:a9b4b2565a23 | 4 | #include <mbed.h> |
yootee | 3:a9b4b2565a23 | 5 | |
yootee | 3:a9b4b2565a23 | 6 | /*このライブラリは、Arduinoのlidar lite v3ライブラリを移植したものです。 |
yootee | 3:a9b4b2565a23 | 7 | *I2C i2c(PB_4,PA_7); |
yootee | 3:a9b4b2565a23 | 8 | *LIDARLite lidar_x(i2c); |
yootee | 3:a9b4b2565a23 | 9 | *I2Cのクラスオブジェクトをあらかじめ作り、参照渡ししてください。 |
yootee | 3:a9b4b2565a23 | 10 | */ |
yootee | 3:a9b4b2565a23 | 11 | |
yootee | 3:a9b4b2565a23 | 12 | const char LIDARLITE_ADDR_DEFAULT = 0x62 << 1; |
yootee | 3:a9b4b2565a23 | 13 | |
yootee | 3:a9b4b2565a23 | 14 | class LIDARLite |
yootee | 3:a9b4b2565a23 | 15 | { |
yootee | 3:a9b4b2565a23 | 16 | public: |
yootee | 3:a9b4b2565a23 | 17 | LIDARLite(I2C &i2c); |
yootee | 3:a9b4b2565a23 | 18 | void begin(int = 0, char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 19 | void configure(int = 0, char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 20 | void setI2Caddr(char, bool, char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 21 | void reset(char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 22 | int distance(bool = true, char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 23 | void write(char, char, char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 24 | void read(char, int, char*, bool, char ); |
yootee | 3:a9b4b2565a23 | 25 | void correlationRecordToSerial(char = '\n', int = 256, char = LIDARLITE_ADDR_DEFAULT); |
yootee | 3:a9b4b2565a23 | 26 | private: |
yootee | 3:a9b4b2565a23 | 27 | I2C &i2c_; |
yootee | 3:a9b4b2565a23 | 28 | }; |
yootee | 3:a9b4b2565a23 | 29 | |
yootee | 3:a9b4b2565a23 | 30 | #endif |