Inspiration from https://hackaday.io/project/165620-digital-hourglass, but developed from scratch. Implements a form of Cellular Automata where each grain of sand has simple rules applied for it's movement taking account of the direction of gravity.
- Simple algorithm - move sand grain in gravity direction one pixel, if not possible then try adjacent left/right pixel. Gravity to be determined as either N/S/E/W/NE/NW/SE/SW
- Can take any 'typical' hourglass graphic and work out where to fill it (amount of fill can be changed by simple code change)
- This implementation has 1238 grains (can be varied as required by simple code change)
- If the hourglass is too far off vertical than the grains stop (ie if it is laid flat then the grains stop just like the real thing)
- Timer - when initially pressed will run through as quick as possible, but time required can be 'Set' - orientation is fixed
- Continuous - runs continuously with orientation taken into account
- Set - sets specified hourglass time - when Timer is pushed again will run at set rate - orientation is fixed again
- Cal - runs through like the Timer to calibrate the times. Should be able to more accurately set the specified times.