thanks to Zoltan Hudak publish the way to use stm32f103c8t6 on mbed. now you can use it with Lidar Lite
Dependencies: LidarLitev2 mbed-STM32F103C8T6 mbed
Fork of Wii_IRCam_Test by
main.cpp@2:d69208cb9224, 2017-05-23 (annotated)
- Committer:
- Zeran
- Date:
- Tue May 23 16:50:20 2017 +0000
- Revision:
- 2:d69208cb9224
- Parent:
- 1:150525e9c21f
stm32f103c8t6 lidar lite
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Zeran | 2:d69208cb9224 | 1 | #include "stm32f103c8t6.h" |
shimniok | 0:cf1bc7c313b4 | 2 | #include "mbed.h" |
Zeran | 2:d69208cb9224 | 3 | #include "LidarLitev2.h" |
shimniok | 0:cf1bc7c313b4 | 4 | |
shimniok | 0:cf1bc7c313b4 | 5 | |
shimniok | 0:cf1bc7c313b4 | 6 | |
Zeran | 2:d69208cb9224 | 7 | LidarLitev2 Lidar(PB_9, PB_8); |
Zeran | 2:d69208cb9224 | 8 | //I2C i2c(PB_9, PB_8); // sda, scl |
shimniok | 0:cf1bc7c313b4 | 9 | |
shimniok | 0:cf1bc7c313b4 | 10 | |
shimniok | 0:cf1bc7c313b4 | 11 | int main() { |
Zeran | 2:d69208cb9224 | 12 | confSysClock(); |
shimniok | 0:cf1bc7c313b4 | 13 | |
Zeran | 2:d69208cb9224 | 14 | Serial pc(PA_2, PA_3); |
shimniok | 0:cf1bc7c313b4 | 15 | pc.baud(115200); |
Zeran | 2:d69208cb9224 | 16 | pc.printf("config\n"); |
Zeran | 2:d69208cb9224 | 17 | Lidar.configure(); |
Zeran | 2:d69208cb9224 | 18 | pc.printf("config\n"); |
Zeran | 2:d69208cb9224 | 19 | //dt.start(); |
Zeran | 2:d69208cb9224 | 20 | while(1){ |
Zeran | 2:d69208cb9224 | 21 | pc.printf("dis = %d cm \n", Lidar.distance()); |
Zeran | 2:d69208cb9224 | 22 | //dt.reset(); |
shimniok | 0:cf1bc7c313b4 | 23 | } |
shimniok | 0:cf1bc7c313b4 | 24 | |
shimniok | 0:cf1bc7c313b4 | 25 | } |