IoT 2018
Dependencies: mbed
Fork of microbit_blinky by
main.cpp@0:025387782f3e, 2016-03-02 (annotated)
- Committer:
- JonnyA
- Date:
- Wed Mar 02 18:01:16 2016 +0000
- Revision:
- 0:025387782f3e
- Child:
- 1:0b38b848a5f0
Initial Commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JonnyA | 0:025387782f3e | 1 | #include "mbed.h" |
JonnyA | 0:025387782f3e | 2 | /* |
JonnyA | 0:025387782f3e | 3 | * All the LEDs on the micro:bit are part of the LED Matrix, |
JonnyA | 0:025387782f3e | 4 | * In order to get simple blinking behaviour, we set column 0 |
JonnyA | 0:025387782f3e | 5 | * to be permanently at ground. If you want to use the LEDs as |
JonnyA | 0:025387782f3e | 6 | * a screen, there is a display driver in the micro:bit 'DAL', |
JonnyA | 0:025387782f3e | 7 | */ |
JonnyA | 0:025387782f3e | 8 | DigitalOut col0(P0_4, 0); |
JonnyA | 0:025387782f3e | 9 | |
JonnyA | 0:025387782f3e | 10 | DigitalOut myled(P0_13); |
JonnyA | 0:025387782f3e | 11 | |
JonnyA | 0:025387782f3e | 12 | int main() { |
JonnyA | 0:025387782f3e | 13 | while(1) { |
JonnyA | 0:025387782f3e | 14 | myled = 1; |
JonnyA | 0:025387782f3e | 15 | wait(0.2); |
JonnyA | 0:025387782f3e | 16 | myled = 0; |
JonnyA | 0:025387782f3e | 17 | wait(0.2); |
JonnyA | 0:025387782f3e | 18 | } |
JonnyA | 0:025387782f3e | 19 | } |