-
• #2
trolololo.csv
I see, I made an instruction here
. -
• #3
@Ganblejs I'm not sure I understand?
Is this a Bangle.js 1 or 2?
I think the issue is you're storing large amounts of data in RAM with your
buffer.data.push([
. If you keep adding stuff to a normal array it's not stored very efficiently.Right now it seems you have 100 samples, but for each sample you store 13 bits of data (which can sometimes require up to 26 vars) - you can be using 2600 vars. Normally it wouldn't be a huge deal as Bangle.js 2 has 12000 in total, but for the v1 it could cause problems.
There is some info at https://www.espruino.com/Performance#array-buffers-are-the-most-efficient-way-to-store-data about how to store in an arraybuffer.
You can use a DataView to store different types of data in one big array: https://www.espruino.com/Reference#l_DataView_DataView
But... if you used a Typed array for each data entry (eg a.x/a.y/etc) then you can use built-in methods like
E.sum
andE.variance
(https://www.espruino.com/Reference#l_E_variance) to work out mean and standard deviation really quickly. -
• #4
I only tried to joke regarding the file name @user149667 used in the example code. But it was somewhat ruined by the video being embedded rather than just being linked to 🙃
-
• #6
Lol I just realised hehe.
New to both Bangle and JavaScript.
I am currently trying to save all the HRM, accelerometer and magnetometer output's individual average and standard deviation once in minute. The code below is giving me Interpreter error: LOW_MEMORY.
Please help.