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
- Committer:
- matroxmike
- Date:
- 2019-10-22
- Revision:
- 7:0f62c513f003
- Parent:
- 6:83feebd43ec8
- Child:
- 8:7a49220aaa22
File content as of revision 7:0f62c513f003:
#include "mbed.h" /* * All the LEDs on the micro:bit are part of the LED Matrix, * In order to get simple blinking behaviour, we set column 0 * to be permanently at ground. If you want to use the LEDs as * 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); } // https://www.iot-programmer.com/index.php/books/27-micro-bit-iot-in-c/chapters-micro-bit-iot-in-c/54-micro-bit-iot-in-c-the-led-display DigitalOut col1(P0_4,0); DigitalOut col2(P0_5,0); DigitalOut col3(P0_6,0); DigitalOut col4(P0_7,0); DigitalOut col5(P0_8,0); DigitalOut col6(P0_9,0); DigitalOut col7(P0_10,0); DigitalOut col8(P0_11,0); DigitalOut col9(P0_12,0); //DigitalOut row3(P0_15); // something DigitalOut row1(P0_13); // something DigitalOut row2(P0_14); // guessing the layout of the LEDs ATM DigitalOut row3(P0_15); // something int main() { while(1) { // for (int cv = 0; cv < 4 ; cv++) { // myLedBlink(seq[cv]); // } row3 = 1; wait(0.2); row3 = 0; wait(0.2); // ** row2 = 1; wait(0.2); row2 = 0; wait(0.2); // ** row1 = 1; wait(0.2); row1 = 0; wait(0.2); // ** //} // for (int cv = 0; cv < 3 ; cv++) { // myLedBlink(cv); // } } }