nrf24l01 arduino to raspberry pi struct

Solutions on MaxInterview for nrf24l01 arduino to raspberry pi struct by the best coders in the world

showing results for - "nrf24l01 arduino to raspberry pi struct"
Emily
03 Feb 2017
1while True:
2
3    while not radio.available(0):
4      ##  print("Nepareina")
5        time.sleep(1)
6
7    # wrong: duomenys = []
8    # right:
9    nbBytesData = 8		# nbBytesData is the expected size of the incoming array in bytes
10    duomenys = bytearray(nbBytesData)
11
12    radio.read(duomenys, radio.getDynamicPayloadSize())
13    data = struct.unpack('ff',duomenys)
14    rollx = data [0]
15    pitchy = data[1]
16    print(rollx)
17    print("                              ")
18    print(pitchy)
19