Skip to content

Instantly share code, notes, and snippets.

@TakehikoShimojima
Created June 23, 2018 02:36
Show Gist options
  • Select an option

  • Save TakehikoShimojima/bcb12be9beba26d2b631a97c548de0bd to your computer and use it in GitHub Desktop.

Select an option

Save TakehikoShimojima/bcb12be9beba26d2b631a97c548de0bd to your computer and use it in GitHub Desktop.
def send2ambient(am, dataRow):
(seq, temp, humid, light, uv, press, noise, discom, heat, batt) = struct.unpack('<BhhhhhhhhH', dataRow)
am.send({'d1': temp / 100, 'd2': humid / 100, 'd3': press / 10, 'd4': batt / 1000, 'd5': light, 'd6': noise / 100})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment