![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Back-up File from jvfausto
main.cpp@6:28da18c8ba47, 2020-01-25 (annotated)
- Committer:
- JesiMiranda
- Date:
- Sat Jan 25 20:58:01 2020 +0000
- Revision:
- 6:28da18c8ba47
- Parent:
- 5:40d3acd18c03
Included updated os library
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 | |
JesiMiranda | 5:40d3acd18c03 | 4 | Serial pc(USBTX,USBRX, 57600); |
jvfausto | 1:0038ad0a63af | 5 | |
JesiMiranda | 5:40d3acd18c03 | 6 | VL53L1X sensor1(D4, D5, D6); //D6 |
JesiMiranda | 5:40d3acd18c03 | 7 | //VL53L1X sensor2(D4, D5, D7); |
JesiMiranda | 5:40d3acd18c03 | 8 | //VL53L1X sensor3(D4, D5, D8); |
JesiMiranda | 5:40d3acd18c03 | 9 | //VL53L1X sensor4(D4, D5, D9); |
jvfausto | 4:f6f0c2b9120a | 10 | /*VL53L1X frontRight(PD_13, PD_12, D3); //(SCL, SDA, shutdown) |
jvfausto | 4:f6f0c2b9120a | 11 | VL53L1X frontRight2(PD_13, PD_12, D2); //(SCL, SDA, shutdown) |
jvfausto | 4:f6f0c2b9120a | 12 | VL53L1X frontRight3(PD_13, PD_12, D4); //(SCL, SDA, shutdown) |
jvfausto | 4:f6f0c2b9120a | 13 | VL53L1X frontRight4(PD_13, PD_12, D5); //(SCL, SDA, shutdown) |
jvfausto | 4:f6f0c2b9120a | 14 | */ |
jvfausto | 0:617f20c6b21d | 15 | int main() |
jvfausto | 0:617f20c6b21d | 16 | { |
jvfausto | 4:f6f0c2b9120a | 17 | wait(5); |
jvfausto | 4:f6f0c2b9120a | 18 | |
jvfausto | 4:f6f0c2b9120a | 19 | /* frontRight.initReading(0x25,50000); |
jvfausto | 4:f6f0c2b9120a | 20 | frontRight2.initReading(0x27,50000); |
jvfausto | 4:f6f0c2b9120a | 21 | frontRight3.initReading(0x35,50000); |
jvfausto | 4:f6f0c2b9120a | 22 | frontRight4.initReading(0x37,50000);/* |
jvfausto | 4:f6f0c2b9120a | 23 | */sensor1.initReading(0x27,50000); |
JesiMiranda | 5:40d3acd18c03 | 24 | //sensor2.initReading(0x35,50000); |
JesiMiranda | 5:40d3acd18c03 | 25 | //sensor3.initReading(0x37,50000); |
jvfausto | 0:617f20c6b21d | 26 | |
jvfausto | 0:617f20c6b21d | 27 | while(1) |
jvfausto | 0:617f20c6b21d | 28 | { |
jvfausto | 4:f6f0c2b9120a | 29 | pc.printf("%d, ", sensor1.readFromOneSensor()); |
JesiMiranda | 5:40d3acd18c03 | 30 | //pc.printf("%d, ", sensor2.readFromOneSensor()); |
JesiMiranda | 5:40d3acd18c03 | 31 | //pc.printf("%d, ", sensor3.readFromOneSensor()); |
jvfausto | 1:0038ad0a63af | 32 | pc.printf("\r\n"); |
jvfausto | 4:f6f0c2b9120a | 33 | /* |
jvfausto | 4:f6f0c2b9120a | 34 | pc.printf("%d hello\r\n", frontRight.readFromOneSensor()); |
jvfausto | 4:f6f0c2b9120a | 35 | pc.printf("%d hello\r\n", frontRight2.readFromOneSensor()); |
jvfausto | 4:f6f0c2b9120a | 36 | pc.printf("%d hello\r\n", frontRight3.readFromOneSensor()); |
jvfausto | 4:f6f0c2b9120a | 37 | pc.printf("%d hello\r\n", frontRight4.readFromOneSensor()); */ |
jvfausto | 0:617f20c6b21d | 38 | } |
jvfausto | 0:617f20c6b21d | 39 | } |