You are reading a single comment by @Owen and its replies. Click here to read the full conversation.
  • I still get an error when trying to copy the buffer even when there is output data in it? Here is the full test code.

    // Set up matrix
    SPI2.setup({baud:3200000, mosi:B15});
    var m = Graphics.createArrayBuffer(16,8,24,{zigz­ag:true});
    m.flip = function(){ SPI2.send4bit(m.buffer, 0b0001, 0b0011); };
    m.setRotation(1); // Rotate board 90degs
    var mCopy = Graphics.createArrayBuffer(16,8,24,{zigz­ag:true});
    
    m.setColor(0.3, 0.5, 0.7);
    m.setPixel(0,0);
    m.setPixel(4,4);
    m.flip();
    // Save copy
    mCopy.buffer.set(m.buffer);
    // Clear matrix
    m.clear();
    m.flip();
    // copy it back
    m.buffer.set(mCopy.buffer);
    m.flip();
    
    Uncaught Error: Field or method does not already exist, and can't create it on ArrayBuffer
     at line 1 col 13
    mCopy.buffer.set(m.buffer);
                 ^
     at line 1 col 9
    m.buffer.set(mCopy.buffer);
    
About

Avatar for Owen @Owen started