>scene =new Uint16Array(32) >scene[0]=0; =0 >scene[1]=5000; =5000 >scene[4]=44444; =44444 >scene =new Uint16Array([0, 5000, 0, 0, 44444, ... 0, 0, 0, 0, 0]) >buff=new Uint8Array(64); =new Uint8Array(64) >E.toUint8Array(scene); =new Uint8Array([0, 136, 0, 0, 156, ... 0, 0, 0, 0, 0]) //truncated >temp=new Uint8Array(64); =new Uint8Array(64) >temp.set(scene); =undefined >temp =new Uint8Array([0, 136, 0, 0, 156, ... 0, 0, 0, 0, 0]) //truncated >E.toString(scene) ="\x00\x88\x00\x00\x9C\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" //truncated >temp = E.toUint8Array(E.toString(scene)); =new Uint8Array([0, 136, 0, 0, 156, ... 0, 0, 0, 0, 0]) >temp=new Uint8Array(scene.buffer) =new Uint8Array([0, 0, 136, 19, 0, ... 0, 0, 0, 0, 0]) //not truncated (what I expected the other things to do)
Are those ones that truncate the values instead of splitting them up supposed to behave that way?
@DrAzzy started
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.
Are those ones that truncate the values instead of splitting them up supposed to behave that way?