Median of 3 filter for multiple time of flight sensors translated from arduino by pololu
Dependents: wheelchaircontrol wheelchaircontrol2 wheelchaircontrol3 wheelchaircontrol4 ... more
main.cpp@1:0038ad0a63af, 2018-10-08 (annotated)
- Committer:
- jvfausto
- Date:
- Mon Oct 08 23:01:21 2018 +0000
- Revision:
- 1:0038ad0a63af
- Parent:
- 0:617f20c6b21d
- Child:
- 4:f6f0c2b9120a
With median of 3 filter and 6 tof sensors
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jvfausto | 0:617f20c6b21d | 1 | #include "mbed.h" |
jvfausto | 0:617f20c6b21d | 2 | #include "VL53L1X.h" |
jvfausto | 0:617f20c6b21d | 3 | |
jvfausto | 1:0038ad0a63af | 4 | Serial pc(USBTX,USBRX, 115200); |
jvfausto | 1:0038ad0a63af | 5 | |
jvfausto | 1:0038ad0a63af | 6 | VL53L1X sensor1(D4, D5, D6); |
jvfausto | 1:0038ad0a63af | 7 | VL53L1X sensor2(D4, D5, D9); |
jvfausto | 1:0038ad0a63af | 8 | VL53L1X sensor3(D4, D5, D10); |
jvfausto | 1:0038ad0a63af | 9 | VL53L1X sensor4(D4, D5, D11); |
jvfausto | 1:0038ad0a63af | 10 | VL53L1X sensor5(D4, D5, D12); |
jvfausto | 1:0038ad0a63af | 11 | VL53L1X sensor6(D4, D5, D13); |
jvfausto | 0:617f20c6b21d | 12 | |
jvfausto | 0:617f20c6b21d | 13 | int main() |
jvfausto | 0:617f20c6b21d | 14 | { |
jvfausto | 0:617f20c6b21d | 15 | sensor1.initReading(0x25,50000); |
jvfausto | 0:617f20c6b21d | 16 | sensor2.initReading(0x27,50000); |
jvfausto | 0:617f20c6b21d | 17 | sensor3.initReading(0x35,50000); |
jvfausto | 1:0038ad0a63af | 18 | sensor4.initReading(0x39,50000); |
jvfausto | 1:0038ad0a63af | 19 | sensor5.initReading(0x41,50000); |
jvfausto | 1:0038ad0a63af | 20 | sensor6.initReading(0x43,50000); |
jvfausto | 0:617f20c6b21d | 21 | |
jvfausto | 0:617f20c6b21d | 22 | while(1) |
jvfausto | 0:617f20c6b21d | 23 | { |
jvfausto | 1:0038ad0a63af | 24 | pc.printf("6,"); |
jvfausto | 1:0038ad0a63af | 25 | pc.printf("%d,", sensor1.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 26 | pc.printf("%d,", sensor2.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 27 | pc.printf("%d,", sensor3.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 28 | pc.printf("%d,", sensor4.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 29 | pc.printf("%d,", sensor5.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 30 | pc.printf("%d", sensor6.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 31 | |
jvfausto | 1:0038ad0a63af | 32 | pc.printf("\r\n"); |
jvfausto | 0:617f20c6b21d | 33 | } |
jvfausto | 0:617f20c6b21d | 34 | } |