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.
main.cpp@3:7777bbcf11f6, 2018-08-09 (annotated)
- Committer:
- jvfausto
- Date:
- Thu Aug 09 19:39:36 2018 +0000
- Revision:
- 3:7777bbcf11f6
- Parent:
- 2:f570ff03fb81
- Child:
- 4:f7520f4259d8
Faster frequency
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| jvfausto | 1:e54ded4af43a | 1 | #include "mbed.h" |
| jvfausto | 1:e54ded4af43a | 2 | #include "VL53L1X.h" |
| jvfausto | 1:e54ded4af43a | 3 | |
| jvfausto | 1:e54ded4af43a | 4 | Serial pc(USBTX,USBRX); |
| jvfausto | 3:7777bbcf11f6 | 5 | bool s1_init = false; |
| jvfausto | 3:7777bbcf11f6 | 6 | bool s2_init = false; |
| jvfausto | 3:7777bbcf11f6 | 7 | bool s3_init = false; |
| jvfausto | 3:7777bbcf11f6 | 8 | bool s4_init = false; |
| jvfausto | 1:e54ded4af43a | 9 | VL53L1X sensor1(D14, D15, D0); |
| jvfausto | 1:e54ded4af43a | 10 | VL53L1X sensor2(D14, D15, D1); |
| jvfausto | 1:e54ded4af43a | 11 | VL53L1X sensor3(D14, D15, D2); |
| jvfausto | 1:e54ded4af43a | 12 | VL53L1X sensor4(D14, D15, D3); |
| jvfausto | 1:e54ded4af43a | 13 | |
| jvfausto | 1:e54ded4af43a | 14 | int main() |
| jvfausto | 2:f570ff03fb81 | 15 | { |
| jvfausto | 3:7777bbcf11f6 | 16 | sensor1.initReading(0x25,50000); |
| jvfausto | 3:7777bbcf11f6 | 17 | sensor2.initReading(0x27,50000); |
| jvfausto | 3:7777bbcf11f6 | 18 | sensor3.initReading(0x35,50000); |
| jvfausto | 3:7777bbcf11f6 | 19 | sensor4.initReading(0x37,50000); |
| jvfausto | 1:e54ded4af43a | 20 | |
| jvfausto | 2:f570ff03fb81 | 21 | while(1) |
| jvfausto | 3:7777bbcf11f6 | 22 | { |
| jvfausto | 2:f570ff03fb81 | 23 | pc.printf("%d, ", sensor1.readFromOneSensor()); |
| jvfausto | 2:f570ff03fb81 | 24 | pc.printf("%d, ", sensor2.readFromOneSensor()); |
| jvfausto | 2:f570ff03fb81 | 25 | pc.printf("%d, ", sensor3.readFromOneSensor()); |
| jvfausto | 3:7777bbcf11f6 | 26 | pc.printf("%d\r\n", sensor4.readFromOneSensor()); |
| jvfausto | 1:e54ded4af43a | 27 | } |
| jvfausto | 1:e54ded4af43a | 28 | } |