to verify the position of the LEDs
This is an attempt to address all the 25 LEDs. This has been done but only on rows. I need to arrange the column calls in some form of array which can be indexed.
main.cpp@1:bd2be1824e78, 2019-10-21 (annotated)
- Committer:
- matrixmike
- Date:
- Mon Oct 21 04:17:54 2019 +0000
- Revision:
- 1:bd2be1824e78
- Parent:
- 0:699a0e5dc3ab
- Child:
- 2:71c7441b477a
exploring the LED naming
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
matrixmike | 0:699a0e5dc3ab | 1 | #include "mbed.h" |
matrixmike | 0:699a0e5dc3ab | 2 | /* |
matrixmike | 0:699a0e5dc3ab | 3 | * All the LEDs on the micro:bit are part of the LED Matrix, |
matrixmike | 0:699a0e5dc3ab | 4 | * In order to get simple blinking behaviour, we set column 0 |
matrixmike | 0:699a0e5dc3ab | 5 | * to be permanently at ground. If you want to use the LEDs as |
matrixmike | 0:699a0e5dc3ab | 6 | * a screen, there is a display driver in the micro:bit 'DAL', |
matrixmike | 0:699a0e5dc3ab | 7 | */ |
matrixmike | 0:699a0e5dc3ab | 8 | // 21 Oct 2019 |
matrixmike | 0:699a0e5dc3ab | 9 | DigitalOut col0(P0_4, 0); |
matrixmike | 0:699a0e5dc3ab | 10 | |
matrixmike | 1:bd2be1824e78 | 11 | //DigitalOut myled3(P0_12); // nothing |
matrixmike | 1:bd2be1824e78 | 12 | DigitalOut myled3(P0_15); // nothing |
matrixmike | 1:bd2be1824e78 | 13 | DigitalOut myled1(P0_13); // something |
matrixmike | 1:bd2be1824e78 | 14 | DigitalOut myled2(P0_14); // guessing the layout of the LEDs ATM |
matrixmike | 0:699a0e5dc3ab | 15 | int main() |
matrixmike | 0:699a0e5dc3ab | 16 | { |
matrixmike | 0:699a0e5dc3ab | 17 | while(1) { |
matrixmike | 0:699a0e5dc3ab | 18 | myled1 = 1; |
matrixmike | 0:699a0e5dc3ab | 19 | myled2 = 1; |
matrixmike | 1:bd2be1824e78 | 20 | myled3 = 1; |
matrixmike | 0:699a0e5dc3ab | 21 | wait(0.2); |
matrixmike | 0:699a0e5dc3ab | 22 | myled1 = 0; |
matrixmike | 0:699a0e5dc3ab | 23 | myled2 = 0; |
matrixmike | 1:bd2be1824e78 | 24 | myled3 = 0; |
matrixmike | 0:699a0e5dc3ab | 25 | wait(0.2); |
matrixmike | 0:699a0e5dc3ab | 26 | } |
matrixmike | 0:699a0e5dc3ab | 27 | } |