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@0:699a0e5dc3ab, 2019-10-21 (annotated)
- Committer:
- matrixmike
- Date:
- Mon Oct 21 03:37:28 2019 +0000
- Revision:
- 0:699a0e5dc3ab
- Child:
- 1:bd2be1824e78
early commit to checking the position of LEDs
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 | 0:699a0e5dc3ab | 11 | DigitalOut myled1(P0_13); |
matrixmike | 0:699a0e5dc3ab | 12 | DigitalOut myled2(P0_14); // guessing the layout of the LEDs ATM |
matrixmike | 0:699a0e5dc3ab | 13 | int main() |
matrixmike | 0:699a0e5dc3ab | 14 | { |
matrixmike | 0:699a0e5dc3ab | 15 | while(1) { |
matrixmike | 0:699a0e5dc3ab | 16 | myled1 = 1; |
matrixmike | 0:699a0e5dc3ab | 17 | myled2 = 1; |
matrixmike | 0:699a0e5dc3ab | 18 | wait(0.2); |
matrixmike | 0:699a0e5dc3ab | 19 | myled1 = 0; |
matrixmike | 0:699a0e5dc3ab | 20 | myled2 = 0; |
matrixmike | 0:699a0e5dc3ab | 21 | wait(0.2); |
matrixmike | 0:699a0e5dc3ab | 22 | } |
matrixmike | 0:699a0e5dc3ab | 23 | } |