Eduardo Vergara
/
BNO080_program
added main and defined M_PI
main.cpp@0:0f12b8c4d5f1, 2019-07-16 (annotated)
- Committer:
- JesiMiranda
- Date:
- Tue Jul 16 16:37:37 2019 +0000
- Revision:
- 0:0f12b8c4d5f1
- Child:
- 1:4a5b43b9502c
added main and defined M_PI;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JesiMiranda | 0:0f12b8c4d5f1 | 1 | /* mbed Microcontroller Library |
JesiMiranda | 0:0f12b8c4d5f1 | 2 | * Copyright (c) 2018 ARM Limited |
JesiMiranda | 0:0f12b8c4d5f1 | 3 | * SPDX-License-Identifier: Apache-2.0 |
JesiMiranda | 0:0f12b8c4d5f1 | 4 | */ |
JesiMiranda | 0:0f12b8c4d5f1 | 5 | |
JesiMiranda | 0:0f12b8c4d5f1 | 6 | #include "mbed.h" |
JesiMiranda | 0:0f12b8c4d5f1 | 7 | #include "BNO080.h" |
JesiMiranda | 0:0f12b8c4d5f1 | 8 | DigitalOut led1(LED1); |
JesiMiranda | 0:0f12b8c4d5f1 | 9 | |
JesiMiranda | 0:0f12b8c4d5f1 | 10 | #define SLEEP_TIME 500 // (msec) |
JesiMiranda | 0:0f12b8c4d5f1 | 11 | |
JesiMiranda | 0:0f12b8c4d5f1 | 12 | BNO080 imu; |
JesiMiranda | 0:0f12b8c4d5f1 | 13 | // main() runs in its own thread in the OS |
JesiMiranda | 0:0f12b8c4d5f1 | 14 | int main() |
JesiMiranda | 0:0f12b8c4d5f1 | 15 | { |
JesiMiranda | 0:0f12b8c4d5f1 | 16 | int count = 0; |
JesiMiranda | 0:0f12b8c4d5f1 | 17 | while (true) { |
JesiMiranda | 0:0f12b8c4d5f1 | 18 | // Blink LED and wait 0.5 seconds |
JesiMiranda | 0:0f12b8c4d5f1 | 19 | led1 = !led1; |
JesiMiranda | 0:0f12b8c4d5f1 | 20 | wait_ms(SLEEP_TIME); |
JesiMiranda | 0:0f12b8c4d5f1 | 21 | ++count; |
JesiMiranda | 0:0f12b8c4d5f1 | 22 | } |
JesiMiranda | 0:0f12b8c4d5f1 | 23 | } |