My Template app for TinyBLE.
Dependencies: mbed BLE_API nRF51822 eMPL_MPU6050
main.cpp@2:45d3ae0a3b3c, 2020-08-22 (annotated)
- Committer:
- arils
- Date:
- Sat Aug 22 02:20:03 2020 +0000
- Revision:
- 2:45d3ae0a3b3c
- Parent:
- 1:cea2f48b1aff
Template Version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
arils | 0:6b6900bd4e1a | 1 | #include "mbed.h" |
arils | 1:cea2f48b1aff | 2 | #include "tiny_ble.h" |
arils | 0:6b6900bd4e1a | 3 | |
arils | 1:cea2f48b1aff | 4 | //AnalogOut led_red(p22); |
arils | 1:cea2f48b1aff | 5 | //AnalogOut led_green(p21); |
arils | 1:cea2f48b1aff | 6 | AnalogOut led_blue(LED_BLUE); |
arils | 0:6b6900bd4e1a | 7 | |
arils | 0:6b6900bd4e1a | 8 | int main() { |
arils | 1:cea2f48b1aff | 9 | /*led_red = 1; |
arils | 1:cea2f48b1aff | 10 | led_green = 1; |
arils | 1:cea2f48b1aff | 11 | led_blue = 1; |
arils | 1:cea2f48b1aff | 12 | |
arils | 0:6b6900bd4e1a | 13 | while(1) { |
arils | 1:cea2f48b1aff | 14 | for (i = 0; i < 1; i+=0.01) { |
arils | 1:cea2f48b1aff | 15 | led_red.write_u16((uint16_t)i); |
arils | 1:cea2f48b1aff | 16 | wait(0.01)z |
arils | 1:cea2f48b1aff | 17 | } |
arils | 1:cea2f48b1aff | 18 | //led_red = 0; |
arils | 1:cea2f48b1aff | 19 | //wait(1); |
arils | 1:cea2f48b1aff | 20 | //led_red = 1; |
arils | 1:cea2f48b1aff | 21 | /wait(1); |
arils | 0:6b6900bd4e1a | 22 | |
arils | 1:cea2f48b1aff | 23 | //led_green = 0; |
arils | 1:cea2f48b1aff | 24 | //wait(1); |
arils | 1:cea2f48b1aff | 25 | //led_green = 1; |
arils | 1:cea2f48b1aff | 26 | //wait(1); |
arils | 0:6b6900bd4e1a | 27 | |
arils | 1:cea2f48b1aff | 28 | //led_blue = 0; |
arils | 1:cea2f48b1aff | 29 | //wait(1); |
arils | 1:cea2f48b1aff | 30 | //led_blue = 1; |
arils | 1:cea2f48b1aff | 31 | //wait(1); |
arils | 1:cea2f48b1aff | 32 | }*/ |
arils | 1:cea2f48b1aff | 33 | |
arils | 1:cea2f48b1aff | 34 | while (1) |
arils | 1:cea2f48b1aff | 35 | for (float i = 0.0; i<1.0; i+=0.1) { |
arils | 1:cea2f48b1aff | 36 | led_blue = i; |
arils | 1:cea2f48b1aff | 37 | wait(0.1); |
arils | 1:cea2f48b1aff | 38 | } |
arils | 0:6b6900bd4e1a | 39 | } |
arils | 1:cea2f48b1aff | 40 | } |