Ferdinand Stueckler
/
MicroBit_blinky
ok
main.cpp@0:916250de503d, 2020-01-13 (annotated)
- Committer:
- stueckler
- Date:
- Mon Jan 13 13:46:45 2020 +0000
- Revision:
- 0:916250de503d
ok
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
stueckler | 0:916250de503d | 1 | #include "mbed.h" |
stueckler | 0:916250de503d | 2 | /* |
stueckler | 0:916250de503d | 3 | * All the LEDs on the micro:bit are part of the LED Matrix, |
stueckler | 0:916250de503d | 4 | * In order to get simple blinking behaviour, we set column 0 |
stueckler | 0:916250de503d | 5 | * to be permanently at ground. If you want to use the LEDs as |
stueckler | 0:916250de503d | 6 | * a screen, there is a display driver in the micro:bit 'DAL', |
stueckler | 0:916250de503d | 7 | */ |
stueckler | 0:916250de503d | 8 | DigitalOut col0(P0_4, 0); |
stueckler | 0:916250de503d | 9 | |
stueckler | 0:916250de503d | 10 | DigitalOut myled(P0_13); |
stueckler | 0:916250de503d | 11 | |
stueckler | 0:916250de503d | 12 | int main() { |
stueckler | 0:916250de503d | 13 | while(1) { |
stueckler | 0:916250de503d | 14 | myled = 1; |
stueckler | 0:916250de503d | 15 | wait(0.2); |
stueckler | 0:916250de503d | 16 | myled = 0; |
stueckler | 0:916250de503d | 17 | wait(0.2); |
stueckler | 0:916250de503d | 18 | } |
stueckler | 0:916250de503d | 19 | } |