public JoystickData Get() { SpiRxBuffer[0] = 0; SpiRxBuffer[1] = 0; while (SpiRxBuffer[0] != 'O' && SpiRxBuffer[1] != 'K') { Spi.WriteRead(SpiTxBuffer, SpiRxBuffer); Thread.Sleep(10); } ReceiveContext.Bind(SpiRxBuffer, BasicTypeDeSerializerContext.BufferStartOffsetDefault); JoystickInput.Get(ReceiveContext); return(JoystickInput); }
public JoystickData Get() { spiRxBuffer[0] = 0; spiRxBuffer[1] = 0; while (spiRxBuffer[0] != 'O' && spiRxBuffer[1] != 'K') { Spi.WriteRead(spiTxBuffer, spiRxBuffer); Thread.Sleep(10); } ReceiveContext.Bind(spiRxBuffer, BasicTypeDeSerializerContext.BufferStartOffsetDefault); var joystickData = new JoystickData(); joystickData.Get(ReceiveContext); return(joystickData); }