Board to Client
Data Format
Data is transferred in the JSON string format
...
{'axes': [-23, -14, 249], 'buttons': 3, 'switches': 1023}
{'axes': [-23, -14, 249], 'buttons': 3, 'switches': 1023}
{'axes': [-23, -14, 249], 'buttons': 3, 'switches': 1023}
...
Data format:
-
'axes[0]' is x-tilt, 'axes[1]' is y-tilt, 'axes[2]' is z-tilt (Range -255 to 255)
-
'buttons'
3: Both not pressed
2: KEY0 (top button) pressed
1: KEY1 (bottom button) pressed
0: both pressed
-
'switches'
10 bit number. Each bit set to '1' which indicates switch flipped on and '0' to indicate switch off.
Client to Server
Topic names
node/0/data/direction
node/0/data/buttons
node/0/data/switches
Data sent for each topic
node/0/data/direction - a list containing 2 bit elements. 4 directions encoded in 2 bits (00-up, 01-down, 10-left, 11-right)
node/0/data/buttons - follow encoding above
node/0/data/switches - 10 bit number. Each bit set to '1' which indicates switch flipped on and '0' to indicate switch off.
Server to Client
For NuttyMode, upon pressing the top button, the client will publish 1 to all other topics except itself.
Topic names
node/1/data/nuttymode
node/2/data/nuttymode
node/3/data/nuttymode
node/4/data/nuttymode
node/5/data/nuttymode
Board to Client
Data Format
Data is transferred in the JSON string format
Data format:
'axes[0]' is x-tilt, 'axes[1]' is y-tilt, 'axes[2]' is z-tilt (Range -255 to 255)
'buttons'
3: Both not pressed
2: KEY0 (top button) pressed
1: KEY1 (bottom button) pressed
0: both pressed
'switches'
10 bit number. Each bit set to '1' which indicates switch flipped on and '0' to indicate switch off.
Client to Server
Topic names
node/0/data/directionnode/0/data/buttonsnode/0/data/switchesData sent for each topic
node/0/data/direction- a list containing 2 bit elements. 4 directions encoded in 2 bits (00-up, 01-down, 10-left, 11-right)node/0/data/buttons- follow encoding abovenode/0/data/switches- 10 bit number. Each bit set to '1' which indicates switch flipped on and '0' to indicate switch off.Server to Client
For
NuttyMode, upon pressing the top button, the client will publish 1 to all other topics except itself.Topic names
node/1/data/nuttymodenode/2/data/nuttymodenode/3/data/nuttymodenode/4/data/nuttymodenode/5/data/nuttymode