Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: m3pi ADXL345_I2C HMC5583L ITG3200 PCA9547 TLC59116 VL6180x RGB-fun xbee
lib/vl6180xManager.h@0:9f02ae958e20, 2015-12-03 (annotated)
- Committer:
- sillevl
- Date:
- Thu Dec 03 07:58:50 2015 +0000
- Revision:
- 0:9f02ae958e20
- Child:
- 4:b2fe3a2545bf
initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sillevl | 0:9f02ae958e20 | 1 | #pragma once |
sillevl | 0:9f02ae958e20 | 2 | |
sillevl | 0:9f02ae958e20 | 3 | #include "mbed.h" |
sillevl | 0:9f02ae958e20 | 4 | #include "PCA9547.h" |
sillevl | 0:9f02ae958e20 | 5 | #include "vl6180x.h" |
sillevl | 0:9f02ae958e20 | 6 | |
sillevl | 0:9f02ae958e20 | 7 | /*enum DistanceSensor{ |
sillevl | 0:9f02ae958e20 | 8 | FRONT, |
sillevl | 0:9f02ae958e20 | 9 | FRONT_RIGHT, |
sillevl | 0:9f02ae958e20 | 10 | RIGHT, |
sillevl | 0:9f02ae958e20 | 11 | BACK_RIGHT, |
sillevl | 0:9f02ae958e20 | 12 | BACK, |
sillevl | 0:9f02ae958e20 | 13 | BACK_LEFT, |
sillevl | 0:9f02ae958e20 | 14 | LEFT, |
sillevl | 0:9f02ae958e20 | 15 | FRONT_LEFT |
sillevl | 0:9f02ae958e20 | 16 | }; */ |
sillevl | 0:9f02ae958e20 | 17 | |
sillevl | 0:9f02ae958e20 | 18 | class VL6180xManager |
sillevl | 0:9f02ae958e20 | 19 | { |
sillevl | 0:9f02ae958e20 | 20 | public: |
sillevl | 0:9f02ae958e20 | 21 | VL6180xManager(PinName sda, PinName scl); |
sillevl | 0:9f02ae958e20 | 22 | void select(int index); |
sillevl | 0:9f02ae958e20 | 23 | int* getAllDistance(int data[]); |
sillevl | 0:9f02ae958e20 | 24 | |
sillevl | 0:9f02ae958e20 | 25 | protected: |
sillevl | 0:9f02ae958e20 | 26 | |
sillevl | 0:9f02ae958e20 | 27 | /* enum DistanceSensor { |
sillevl | 0:9f02ae958e20 | 28 | FRONT, |
sillevl | 0:9f02ae958e20 | 29 | FRONT_RIGHT, |
sillevl | 0:9f02ae958e20 | 30 | RIGHT, |
sillevl | 0:9f02ae958e20 | 31 | BACK_RIGHT, |
sillevl | 0:9f02ae958e20 | 32 | BACK, |
sillevl | 0:9f02ae958e20 | 33 | BACK_LEFT, |
sillevl | 0:9f02ae958e20 | 34 | LEFT, |
sillevl | 0:9f02ae958e20 | 35 | FRONT_LEFT |
sillevl | 0:9f02ae958e20 | 36 | };*/ |
sillevl | 0:9f02ae958e20 | 37 | PCA9547 mux; |
sillevl | 0:9f02ae958e20 | 38 | I2C i2c; |
sillevl | 0:9f02ae958e20 | 39 | int address; |
sillevl | 0:9f02ae958e20 | 40 | VL6180x sensor; |
sillevl | 0:9f02ae958e20 | 41 | |
sillevl | 0:9f02ae958e20 | 42 | static const int SENSOR_COUNT = 8; |
sillevl | 0:9f02ae958e20 | 43 | static const int VL6180X_ADDRESS = 0x52; |
sillevl | 0:9f02ae958e20 | 44 | }; |