Wednesday 11 October 2017

FOUR FUNCTION CALCULATOR APP

To test out the use of the new keypad encoder and LCD driver that is now built into Tachyon I wrote a very small calculator app (316 bytes) in 78 lines including comment lines etc.

In the process I found that the lines that I shared between the LCD and the keypad were causing problems as the keypad was being scanned by the timer cog and the LCD could be written to anytime. So I decided to buffer the LCD so the timer cog is now responsible for refreshing the LCD. This also means that the LCD can be called from another task without I/O conflicts or delays.


Anyhow, the calculator is setup on a 20x4 LCD along with a 4x4 keypad and the LCD displays the last three entries over 3 lines.




Next step is to interface F32, the floating point ROM built-into Tachyon and add a larger keypad for a programmable scientific calculator!

1 comment:

  1. Gidday Peter,

    I'm building a scanning tunnelling microscope, and to that end I have designed and built a small Propeller system that can accept up to 4 I/O cards, so I can develop the electronics incrementally. Mulling over what to language program it in (Spin/PASM/PropGCC?), I recently discovered Tachyon Forth - seems like just what I need, compact and fast.
    I've loaded up v4.7 and put together some code to run a stepper motor connected to the system, works a treat. Now I'm looking to participate in the discussions (i.e. pester you with questions) on the Parallax forums, but they are using reCAPTCHA v1 as part of the registration process, which doesn't work any more, so I can't register! I've sent the webmaster an email, waiting to hear back.
    Hope to see you on the forums soon, and keep up the great work!

    ReplyDelete