Median of 3 filter for multiple time of flight sensors translated from arduino by pololu
Dependents: wheelchaircontrol wheelchaircontrol2 wheelchaircontrol3 wheelchaircontrol4 ... more
Diff: VL53L1X.h
- Revision:
- 3:0d2f2f31469b
- Parent:
- 0:617f20c6b21d
diff -r 0038ad0a63af -r 0d2f2f31469b VL53L1X.h --- a/VL53L1X.h Mon Oct 08 23:01:21 2018 +0000 +++ b/VL53L1X.h Sun May 05 02:40:10 2019 +0000 @@ -3,6 +3,46 @@ #include "mbed.h" +/* EXAMPLE CODE + +#include "mbed.h" +#include "VL53L1X.h" + +Serial pc(USBTX,USBRX, 115200); + +VL53L1X sensor1(D4, D5, D6); +VL53L1X sensor2(D4, D5, D9); +VL53L1X sensor3(D4, D5, D10); +VL53L1X sensor4(D4, D5, D11); +VL53L1X sensor5(D4, D5, D12); +VL53L1X sensor6(D4, D5, D13); + +int main() +{ + sensor1.initReading(0x25,50000); + sensor2.initReading(0x27,50000); + sensor3.initReading(0x35,50000); + sensor4.initReading(0x39,50000); + sensor5.initReading(0x41,50000); + sensor6.initReading(0x43,50000); + + while(1) + { + pc.printf("6,"); + pc.printf("%d,", sensor1.readFromOneSensor()); + pc.printf("%d,", sensor2.readFromOneSensor()); + pc.printf("%d,", sensor3.readFromOneSensor()); + pc.printf("%d,", sensor4.readFromOneSensor()); + pc.printf("%d,", sensor5.readFromOneSensor()); + pc.printf("%d", sensor6.readFromOneSensor()); + + pc.printf("\r\n"); + } +} + +*/ + + class VL53L1X { public: