Skip to content

electrickery/InfidelRunningStat

Repository files navigation

Infidel data statistics demo sketch for Arduino.

These files are the basic Arduino sketch interfacing the Infidel, LCD-display and a simple library implementing running statistics. The original library usage of double precision floats works better than the own hacked fixed-precision one I hacked, so I removed it.

The LCD display just shows the actual value, mean value, standard deviation, minimum value, maximum value and the number of measurements. The Serial console displays more fractional digits and also values from the original RunningStat library. The Min() and Max() were my addition.

The 0.4 version add simple support for two buttons at the A2 and A3 pins:

  • upper button - start count
  • lower button - stop count
  • both buttons - reset statistic data

The lower right character position is used to indicate running status with alternating '-' and '|' characters. If the counting is stopped, a space is printed.

Output of the Serial console looks like this:

...
Diameter: 1.68 mm, Count: 4, Mean: 1.6862, Variance: 0.000012, Stdev: 0.0035, Min: 1.68, Max: 1.69,
Diameter: 1.68 mm, Count: 5, Mean: 1.6846, Variance: 0.000023, Stdev: 0.0048, Min: 1.68, Max: 1.69,
Diameter: 1.68 mm, Count: 6, Mean: 1.6833, Variance: 0.000028, Stdev: 0.0053, Min: 1.68, Max: 1.69,
Diameter: 1.68 mm, Count: 7, Mean: 1.6823, Variance: 0.000031, Stdev: 0.0056, Min: 1.68, Max: 1.69,
...

ToDo:

  • work out why the Arduino IDE doesn't want to work with the library header file. Including source code is not the correct way, but it appears to work.
  • Allowing changing the measurement interval, now fixed to 5 seconds. There is a rudimentary command interpreter included, but only commands for starting, pausing, muting, umuting and clearing are implemented.
  • Add reset for min and max values.
  • Add '' and '/' to running status sequence.

F.J. Kraan, fjkraan@electrickery.nl

Screenshot of the LCD showing actual diameter, mean (Avg), standard deviation (SD), minimum, maximum and measurement count.

The infidel attached to the extruder of a Prusa MK3S+ 3D-printer

About

An Arduino sketch for statistics of the Infidel filament sensor data

Resources

Stars

Watchers

Forks

Packages

No packages published