![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This library allows you to read from multiple VL53L1X sensors.
Fork of VL53L1X_Pololu by
Diff: main.cpp
- Revision:
- 3:7777bbcf11f6
- Parent:
- 2:f570ff03fb81
diff -r f570ff03fb81 -r 7777bbcf11f6 main.cpp --- a/main.cpp Thu Aug 09 18:12:38 2018 +0000 +++ b/main.cpp Thu Aug 09 19:39:36 2018 +0000 @@ -2,7 +2,10 @@ #include "VL53L1X.h" Serial pc(USBTX,USBRX); - +bool s1_init = false; +bool s2_init = false; +bool s3_init = false; +bool s4_init = false; VL53L1X sensor1(D14, D15, D0); VL53L1X sensor2(D14, D15, D1); VL53L1X sensor3(D14, D15, D2); @@ -10,16 +13,16 @@ int main() { - sensor1.initReading(0x25,25000); - sensor2.initReading(0x27,25000); - sensor3.initReading(0x35,25000); - sensor4.initReading(0x37,25000); + sensor1.initReading(0x25,50000); + sensor2.initReading(0x27,50000); + sensor3.initReading(0x35,50000); + sensor4.initReading(0x37,50000); while(1) - { + { pc.printf("%d, ", sensor1.readFromOneSensor()); pc.printf("%d, ", sensor2.readFromOneSensor()); pc.printf("%d, ", sensor3.readFromOneSensor()); - pc.printf("%d, \r\n", sensor4.readFromOneSensor()); + pc.printf("%d\r\n", sensor4.readFromOneSensor()); } }