-
-
-
-
-
-
-
-
-
-
-
Hi,
I want to display a graph:
require("graph").drawLine(g, steps, { axes : true, gridy : gridyValue, y : 50, //offset on screen x : 5, //offset on screen });
When uploading to RAM from IDE, the code works, the graph is displayed.
When installed as an application from the app loader, I get this error in IDE and the graph is not displayed:Uncaught Error: Module graph not found at line 26 col 20 require("graph").drawLine(g, steps, { ^ in function "drawGraph" called from line 3 col 15 drawGraph(); ^ in function called from system
Thanks
Christian -
I made a bugfix. Normally only 00:00 (minutes:seconds) should de displayed, when less than 1 hour is left. But I miscalculated the milliseconds.
Fixed in https://github.com/espruino/BangleApps/pull/330 -
-
Hi,
I am reading a CSV file.
1587107584119.07397460937,109,0,443,5487,11174 1587107884119.04345703125,109,0,443,5503,11198 1587109990123.19384765625,165,0,445,5546,11242 1587110290123.16333007812,165,0,445,5567,11271
const storage = require("Storage"); var csvFile = storage.open("activepedom.data.json", "r");
Then I create an array from the entries.
function getArrayFromCSV(file, index) { i = 0; array = []; now = new Date(); while ((nextLine = file.readLine())) { //as long as there is a next line if(nextLine) { dataSplitted = nextLine.split(','); //split line, 0= time, 1=stepsCounted, 2=active, 3=stepsTooShort, 4=stepsTooLong, 5=stepsOutsideTime diff = now - dataSplitted[0]; //calculate difference between now and stored time if (diff <= history) { //only entries from the last x ms array.push(dataSplitted[index]); } } i++; } return array; }
To get an array with the first column from all lines in a certain timeframe (diff <= history):
times = getArrayFromCSV(csvFile, 0);
This works fine.
But as soon as I want to use the function for other columns, I only receive empty arrays ([]).
Example:times = getArrayFromCSV(csvFile, 0); steps = getArrayFromCSV(csvFile, 1);
times is filled correctly, steps is an empty array.
I can call each one individually, but never more than 1.
What is wrong?Thanks
-
-
That's it saying it's not calibrated. Turn around 360 degrees and it'll start working
I found it misleading and changed it, see PR https://github.com/espruino/BangleApps/pull/316
-
-
-
-
-
-
-
The buzz doesn't go off when the timer reaches zero, but rather one second after when END is displayed. In other words, a 10 second timer becomes an 11 second timer...
Yes, that is because I am checking only for full seconds, not ms.
Before the differnec between now and goal time had to be <=0. If you start the timer at 11:00:00:0500 it would only buzz when an additional second has passed, so at 11:00:01:0500.I changed it so that it now alerts when difference is < 1000, so it alerts at the right second (500 ms left is <1000).
Advantage: buzzes when 00:00 is shown.
Drawback: now it may alerts too early:
Goal: 11:00:00:0001
Timer: 10 seconds
Planned alert: 11:00:10:0001
Actual alert at 11:00:09:0002 because diff is <1000.But this is an extreme case and I could live that.
Nevertheless, I added the following note to the readme file.
Depending on when you start the timer, it may alert up to 0,999 seconds early. This is because it checks only for full seconds. When there is less than one seconds left, it buzzes. This cannot be avoided without checking more than every second, which I would like to avoid.maybe a reset option in the app? To set everything back to zero.
Good idea, will do that.
No idea if it is technically possible.
But I just thought about refresh time and life of the screen.
The firmware and all apps are not made for e-ink displays. This might lead to too many refreshs and bad readability and a shirt life of the screen.