Yes, there are 2 easyish ways - Float32Array and DataView.
DataView is the nicest though:
var arr = new Uint8Array(4);
d = new DataView(arr.buffer) ;
d.setFloat32(0,1234);
print(arr) // it contains [68, 154, 64, 0]
You can pack lots of different types of data (double,float,int,short,byte,etc) with different endianness, all in the same array. Check out the DataView reference for the various methods: http://www.espruino.com/Reference#DataView
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.
Yes, there are 2 easyish ways - Float32Array and DataView.
DataView is the nicest though:
You can pack lots of different types of data (double,float,int,short,byte,etc) with different endianness, all in the same array. Check out the DataView reference for the various methods: http://www.espruino.com/Reference#DataView