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.
Diff: main.cpp
- Revision:
- 2:71c7441b477a
- Parent:
- 1:bd2be1824e78
- Child:
- 3:c6d14249d784
diff -r bd2be1824e78 -r 71c7441b477a main.cpp --- a/main.cpp Mon Oct 21 04:17:54 2019 +0000 +++ b/main.cpp Mon Oct 21 13:16:12 2019 +0000 @@ -6,22 +6,41 @@ * a screen, there is a display driver in the micro:bit 'DAL', */ // 21 Oct 2019 +int seq[5] = {P0_15,P0_13,P0_14,P0_11}; +void myLedBlink(int led) +{ + led = 1; + wait(0.2); + led = 0; + wait(0.2); +} + DigitalOut col0(P0_4, 0); -//DigitalOut myled3(P0_12); // nothing -DigitalOut myled3(P0_15); // nothing +DigitalOut myled3(P0_15); // something +DigitalOut myled4(P0_11); // something DigitalOut myled1(P0_13); // something DigitalOut myled2(P0_14); // guessing the layout of the LEDs ATM + int main() { while(1) { + for (int cv = 0; cv < 4 ; cv++) { + myLedBlink(seq[cv]); + } myled1 = 1; myled2 = 1; myled3 = 1; + myled4 = 1; wait(0.2); myled1 = 0; myled2 = 0; myled3 = 0; + myled4 = 0; wait(0.2); + //} +// for (int cv = 0; cv < 3 ; cv++) { +// myLedBlink(cv); +// } } -} +} \ No newline at end of file