Format C Type Python type Standard size
h short integer 2
x pad byte no value
I unsigned int integer 4
B unsigned char integer 1
H unsigned short integer 2
How can I do this with the ArrayBuffer in JavaScript?
var data =
new ArrayBuffer([215, 0, 0, 208, 13, 0, 0, 20, 53, 1, 2, 60, 0, 251, 52, 155]);
// 21.5 C, type h
var temp = data[0]/10;
// ~ 3500 lux, data[2],data[3],data[4], 0,208,13, type I
//var sunlight = ?
// 20 %, data[7], type B
var moister = data[7];
// 315, data[8], data[9], type H
//var fertility = ?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Format C Type Python type Standard size
h short integer 2
x pad byte no value
I unsigned int integer 4
B unsigned char integer 1
H unsigned short integer 2
How can I do this with the ArrayBuffer in JavaScript?
I wonder if there is an easy solution to this?