You are reading a single comment by @JumJum and its replies. Click here to read the full conversation.
  • I would like to do some testing on this.
    @Gordon, could you please take a look to attached code before I start testing ?
    Usually 4 eyes see more than 2

    Pins are the same as used in an working ESP32-only solution. This part should be correct.

    I've some questions:

    • what is repeat in shiftOut.bind ?
    • why do you have enable pin twice in digitalWrite ?
    • we only have 4 address bytes, how would we control 32 rows ? Seems to be a non Espruino
      questions, but may be you have some ideas
    • should we init enable to 1 ?


    function LedMatrix(){
      var me = this;
      var gr,buf; //graphics object and buffer in graphics object
      var sfnc,dfnc; //function calls to send data to LED Matrix
      var Pr1,Pr2,Pb1,Pb2,Pg1,Pg2; //Color Pins
      var Pa,Pb,Pc,Pd; //address pins
      var Platch,Pclock,Penable; //control pins
      me.init = function(R1,R2,B1,B2,G1,G2,A,B,C,D,Latch­,Clock,Enable){
        Pr1 = R1; Pr2 = R2; Pb1 = B1; Pb2 = B2; Pg1 = G1; Pg2 = G2;
        Pa = A; Pb = B; Pc = C; Pd = D;
        Platch = Latch; Pclock = Clock; Penable = Enable;
        gr = Graphics.createArrayBuffer(64,32,8);
        buf = gr.buffer;
        return gr;
      };
      sfnc = shiftOut.bind(null,[Pr1,Pr2,Pb1,Pb2,Pg1,­Pg2],{clk:Pclock,repeat : 8});
      dfnc = digitalWrite.bind(null,[Penable,Platch,P­d,Pc,Pb,Pa,Penable]);
      me.scan = function(){
        enable.reset();
        for (var y=0;y<16;y++) {
          sfnc(new Uint8Array(u,y*64,64));
          dfnc(33|y<<1);
        }
        enable.set();
      };
    }
    var led = new LedMatrix();
    function test(){
      var ledGraphik = led.init(2,16,4,17,15,27,5,18,19,21,26,2­2,25);
      ledGraphik.setBgColor(0);
      ledGraphik.clear();
      ledGraphik.SetColor(17);
      ledGraphik.clear();
      ledGraphik.fillRect(0,0,3,3);
      led.scan();
    }
    
About

Avatar for JumJum @JumJum started