Search in sources :

Example 1 with SPIChannel

use of com.neuronrobotics.sdk.dyio.peripherals.SPIChannel in project java-bowler by NeuronRobotics.

the class SPITest method main.

public static void main(String[] args) throws InterruptedException {
    DyIO dyio = new DyIO();
    if (!ConnectionDialog.getBowlerDevice(dyio)) {
        System.exit(0);
    }
    // Instantiate the SPI
    SPIChannel spi = new SPIChannel(dyio);
    ByteList dataStream = new ByteList(new byte[] { 33, 55, 66, 77, 88, 99 });
    int slaveSelectChannelNumber = 3;
    // Send data to the SPI channel using the given DYIO channel as the slave select.
    byte[] back = spi.write(slaveSelectChannelNumber, dataStream.getBytes());
    // Cleanup and exit
    dyio.disconnect();
    System.exit(0);
}
Also used : ByteList(com.neuronrobotics.sdk.common.ByteList) DyIO(com.neuronrobotics.sdk.dyio.DyIO) SPIChannel(com.neuronrobotics.sdk.dyio.peripherals.SPIChannel)

Aggregations

ByteList (com.neuronrobotics.sdk.common.ByteList)1 DyIO (com.neuronrobotics.sdk.dyio.DyIO)1 SPIChannel (com.neuronrobotics.sdk.dyio.peripherals.SPIChannel)1