I just saw your other post and the title, and with the MCP23017 the code would look a little like this:
var port = require("MCP23017").connect(i2c, null, address);
var mosi = port.A0;
var sclk = port.A1;
var spi = {
write : function(data,cs) {
if (cs) cs.write(0);
E.toUint8Array(data).forEach(function(byte) {
for (var i=7;i>=0;i++) {
mosi.write((byte>>i)&1);
sclk.write(1);
sclk.write(0);
}
});
if (cs) cs.write(1);
}
};
var disp = require("MAX7219").connect(spi,port.A2);
Not tested, but it should work. The nRF24 reads from SPI, so you'd need to implement an SPI.send function to get it working though.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I just saw your other post and the title, and with the MCP23017 the code would look a little like this:
Not tested, but it should work. The nRF24 reads from SPI, so you'd need to implement an
SPI.send
function to get it working though.