Been teaching myself programming for several years and I'm looking for jobs to grow as a professional.
So I had this seriously old Casio graphing calculator that was
starting to die, with dead pixel columns and what not.
I live in Argentina where electronic devices are really
expensive so I couldn't afford a new one, so I eventually
got the great idea of taking it's keypad and hook it up to
an Arduino and start playing around.
After some experimenting and research I figured out that it works just like this 4x4 matrix keypad that comes with your Arduino UNO bundle, so I mapped out the keys and began soldering the pins.
It consists of two Arduinos that communicate with each other:
a basic Pro Mini that manages the keypad and power functions, and
a big fat Due which parses the expressions and renders the 3.5"
TFT screen. Behind it lies a conventional lithium power bank that
powers up the whole device.
The Arduino Pro Mini receives power continuously, but when turned off it shuts the Due and the screen off with an N-Mosfet and puts itself to sleep in order to save power (it consumes so little the power bank switches off, I'm working on that...) and a hardware interrupt in the On button on the keypad turns on the whole thing again.
One thing I think is pretty interesting is the way the parsed expression is stored for repetitive use. At first, to graph a function, I would just parse the input string for every pixel, genius! Until I came up with an "Operation tree", whose nodes are Nodes which can have zero to two arguments and have an Execute function. Arguments would be more Node instances, so the tree branches end at zero argument nodes, or constants. This way, to graph a function I just call Execute() on the root node of the operation tree.
The input is very responsive even though the old calculator keypad is already giving up.
Current features include expression parsing, featuring most math functions in cmath.h like floor, pow, etc., function graphing and basic navigation through the graph.