Skip to content

Instantly share code, notes, and snippets.

@iani
Created December 30, 2018 13:40
Show Gist options
  • Select an option

  • Save iani/fc9dc39655978fb9fede52144dd9657d to your computer and use it in GitHub Desktop.

Select an option

Save iani/fc9dc39655978fb9fede52144dd9657d to your computer and use it in GitHub Desktop.
concatenate input data arrays from sensor for sending on OSC
while True:
print("sending to osc at address:")
print(clientIP)
# osc.send('/controls/frobnicator', 42, 3.1419, "spamm")
# time.sleep(1.0)
# # print("will send accelerometer next:")
# # time.sleep(1.0)
# USE + TO CONCATENATE DATA!!!!!!!!!!!
# alldata = sensor.accelerometer + sensor.magnetometer + sensor.gyroscope
# SEND ALL DATA LIKE THIS:
# osc.send('/alldata1' *alldata);
osc.send('/acceleration1', *sensor.accelerometer)
osc.send('/magnetometer1', *sensor.magnetometer)
osc.send('/gyroscope1', *sensor.gyroscope)
osc.send('/temperature1', sensor.temperature)
time.sleep(0.01) # patch also works without sleep at all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment