obniz to be used
Rsponse waiting timeout in milliseconds
Calls each of the listeners registered for a given event.
It ends spi
// Javascript Example
obniz.spi0.start({mode:"master", clk :0, mosi:1, miso:2, clock:1000000});
obniz.spi0.write([0x12, 0x98]);
obniz.spi0.end();
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Add a listener for a given event.
Add a one-time listener for a given event.
Remove all listeners, or those of the specified event.
Remove the listeners of a given event.
It starts spi. Now the mode is only "master".
drive and pull are optional settings for io output. Default settings are drive:5v, pull:null. See more using obniz.io.drive() or pull().
// Javascript Example
obniz.spi0.start({mode:"master", clk :0, mosi:1, miso:2, frequency:1000000});
var ret = await obniz.spi0.writeWait([0x12, 0x98]);
console.log("received: "+ret);
// drive and pull is optional
obniz.spi0.start({mode:"master", clk :0, mosi:1, miso:2, frequency:1000000, drive: "5v", pull:null});
spi parameters
It only sends data to spi and does not receive it.
// Javascript Example
obniz.spi0.start({mode:"master", clk :0, mosi:1, miso:2, frequency:1000000});
obniz.spi0.write([0x12, 0x98]);
Max length is 1024 bytes.
It sends data to spi and wait until data are received. The received data length is the same as the sent data.
// Javascript Example
obniz.spi0.start({mode:"master", clk :0, mosi:1, miso:2, frequency:1000000});
var ret = await obniz.spi0.writeWait([0x12, 0x98]);
console.log("received: "+ret);
Max length is 1024 bytes.
received data
Generated using TypeDoc
It is General Purpose SPI