• can i DigitalWrite(array of pins, array of value like the b[i].toString(2))?

    Yes - digitalWrite([pin1,pin2,etc],b[i]) works great.

    I think the issue you have is that you have to 'scan' out the LEDs. You can't light them all at once, you have to light up just one row or column and then do them all in sequence.

    As a simple example, does this light up all the LEDs for you?

    const x= [A6,A5,A8,B7,B6];
    const y=[B5,B4,B3,A7,B1,B10,B13]; //to ground????
    
    function scan() {
    digitalWrite(y,0b1111111);  // all 1 turns all rows off
    for (let i=0; i<7;i++) {
       y[i].reset(); // row on
       digitalWrite(x,0b11111); // set column -> all on
       y[i].set();   // row off
    }
    }
    
    setInterval(scan, 20);
    
About

Avatar for Gordon @Gordon started