Added option for a sparkline.
Added option for sparkline #7
boekenwuurm/sparkline into main
Thanks for the PR; a sparkline would be a nice configurable option. I haven't tried it yet and won't accept the PR in its current form, but have provided some remarks.
@ -0,0 +1,150 @@
// Adaped version of ESParklines to sidestep random() issue in FixedPointsArduino library
I strongly prefer not including forked libraries in the Operame repository, if it can be avoided at all. I've submitted a PR to fix the underlying library instead, at Pharap/FixedPointsArduino#71
Nitpick: the other variables are called _enabled. For consistency, _enabled would be preferred to _enable.
Spelling: length
@ -68,6 +75,10 @@ void display_big(const String& text, int fg = TFT_WHITE, int bg = TFT_BLACK) {
sprite.setTextColor(fg, bg);
sprite.drawString(text, display.width()/2, display.height()/2);
I'm guessing the 766 was supposed to be sparkline_bufferlength? That variable is declared and assigned but not used elsewhere.
I'm curious what the -5 is for.
I'm wondering if having the sparkline in the demo is worth resetting the main history for. OTOH, this makes it consistent with accessing the portal (resetting the microcontroller is the only way out) and does make the demo include the sparkline.
@ -388,6 +406,7 @@ void loop() {
every(5000) {
co2 = get_co2();
Serial.println(co2);
Not translated.
@ -389,3 +407,4 @@
co2 = get_co2();
Serial.println(co2);
if (sparkline_enable ) display_sparkline.add(co2);
}
Maybe the buffer length should not be user configurable, at least not without explaining what it does. If it is configurable, I think it would be slightly more user friendly to let them specify the buffer size in minutes.
Why 16383 and 512?
@ -0,0 +1,150 @@
// Adaped version of ESParklines to sidestep random() issue in FixedPointsArduino library
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?