This is the coolest thing I coded for embedded chips. It is a polynomial regression with gui, yet it can also run without the screen, once configured. It works this way that user adds manually points(x, y), than chooses which polynomial regresion coefficient model fits and observes the calculated function on the screen. Once set up, settings can be saved to the eeprom(save button). After entire gui object can be destroyed, allowing for operation without the screen. Thought this would be very useful pice of code allowing for example to calibrate any non linear sensor in any circuit independently even from programmer's knowledge of theoretical model of inaccuracy. Think about 3d printers, and their struggle to keep the temperature values coherent beetween different models. Instead of using overcomplicated models of thermocouples in circuits user can just put two in one hotend and calibrate them on the screen.
Think about circuits where you want to leave user freedom to choose replacement parts from a buck of photoresistors, phototransistors, and photodiodes. Putting new device next to the reference one and filling a screen chart simplifies everything.
Currently gui sketch takes about 100kB of flash. I will code a version with simple buttons to save space, when the Adafruit_GFX_Button pull resolves. Which version to display will be controlled through a single define. Width and height of the chart are programmer configurable and I recommend screens of 240x320 or bigger for nice looking display. It is possible to use smaller screens, yet buttons will be overlapping each other(still every button should be displayed on the screen).
There are 2 examples. One is for the first run, other for the next runs. It is this way, because first eeprom save location has to be determined, and than there can be used Load_From_Eeprom(this location) at every startup. Although when I think about it now there can be a failed read, than empty save call as well as sucessfull read, than unnecessary save at every startup, providing there isnt garbage data in eeprom earlier.
Library only external dependency is Adafruit_GFX if you want to run GUI.
Video tutorial: https://youtu.be/icBz3evB9uE
Licence: free to use. Please consider donation if you find it usefull. Support info in github files.
Feel free to comment.