Skip to content

Instantly share code, notes, and snippets.

@NorHairil
Last active July 5, 2022 16:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NorHairil/6bb84127f683b20d5e5931a4eb656d5d to your computer and use it in GitHub Desktop.
Save NorHairil/6bb84127f683b20d5e5931a4eb656d5d to your computer and use it in GitHub Desktop.
Google Sheet Decoder for Helium Console
function Decoder(bytes, port) {
var decoded = {};
decoded.temperature = (bytes[0] << 8 | (bytes[1]))
decoded.humidity = (bytes[2] << 8 | (bytes[3]))
// TODO: Transform bytes to decoded payload below
var decodedPayload = {
"temperature": decoded.temperature,
"humidity": decoded.humidity
};
// END TODO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment