- Electronic Design
- Schematic
- PCB
- Wiring
- Mounting Holes
- Case Design
- Top Lid
- Mounting
- Bottom Case
- Decoration
- Buttons
- Button Labels
- Firmware
- Button Scanning
- Button Presses
- Evaluation
- Separating order of operations to tokens
- Ordering tokens as RPN
- Evaluating each operation in correct order
- Screen Display - to be tuned further once actual parts have arrived
- Games - to be made with actual parts
Note
Diodes have been move to bottom layer to allow room for buttons in the case
This is also in the top of the firmware file - it was just the flow of my thoughts and planning so is not perfectly polished
-- PROJECT FLOW --
setup:
- setup IO expander
- setup screen
- display initial screen
loop:
- check for button press
- draw display - could probably leave this out of loop because it reloads on every input
check for button press:
- check whether shifted
- return row + column with shifted/normal key
HANDLE KEY PRESS
Types of key presses:
- Input keys
- number (0-9)
- in-built operation (+ - / * ^)
- special operation (! sqrt otherroot x10^ %)
- trig function (sin cos tan asin acos atan)
- other function (log ln Abs nPr nCr)
- constants (Pi Euler Ans)
- other inputs ('(' ')' ',' '.')
- Control keys
- other (Mode Game Shift)
- deletion (AC DEL)
- equals (= S<=>D Deg/Min/Sec)
- direction (UP DOWN LEFT RIGHT)
Flow:
if input key : append to expression
if control key : check - 'can control be executed before evaluation'
if yes : execute
if no : continue
EVALUATION
- separate expression into order of operations
1. brackets
2. functions
3. exponents
4. operations (* /)
5. operations (+ -)
- evaluate in separated parts
- return ans
- store ans as Ans
- draw display
Flow:
- convert expression to tokens
- turn into RPN
- evaluate RPN
- store Ans
- return ans to display
splay
N
- evaluate RPN
- store Ans
- return ans to display
Interesting Wikipedia page about calculator input methods which I used to learn about RPN methods.
See BOM.md