You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Try changing:

    function SPIwriteOneRegister(regAddress, regValue, spi){
        spi.write([0x0A, regAddress, regValue]);
    }
    

    to

    function SPIwriteOneRegister(regAddress, regValue, spi){
        spi.write([0x0A, regAddress, regValue], D31);
    }
    

    ... you weren't specifying a 'CS' pin, so the writes likely wouldn't have been working.

    Also, if you change:

    function SPIreadOneRegister(regAddress, spi){
        var d = spi.send([0x0B,regAddress,0x00], D31);
        return d[2];
    }
    

    to

    function SPIreadOneRegister(regAddress, spi){
        var d = spi.send([0x0B,regAddress,0x00], D31);
        print(d);
        return d[2];
    }
    

    Then what sort of things are printed to the console?

About

Avatar for Gordon @Gordon started