C translator for calculator project
|
05-10-2019, 08:47 AM
(This post was last modified: 07-10-2019 06:05 AM by Dan.)
Post: #23
|
|||
|
|||
RE: C translator for calculator project
Thank you to everyone for taking the time to share your thoughts, I'm really enjoying reading your posts. KeithB summed it up in the previous post, my aim is to make my programs easier to edit and understand. This would be for small to medium programs, for big projects I would recommend an industrial IDE like Code Composer Studio, which is what I've been using to write the firmware (in C).
For example, here is my keystroke program to generate the Mandelbrot set: Code:
Variable names can be up to 8 characters long and are entered via the command line, as are numbers. This makes the programs shorter and easier to understand. Here is the C version - I think it is much more readable: Code:
Another reason I chose C is because this is the language the firmware is written in. From the outset my goal (pipe dream?) was to make a calculator that others would use and contribute software to, and I thought that if people are using C on the calculator then they may be interested in contributing to the development of the firmware (it really is a big job for one person). However considering how opposed people are to C (whoever thought choosing a calculator programming language could be such a contentious issue!), perhaps I should reconsider. Anyway, I have only used 138K of Flash (out of 1000K) and 15K of RAM (out of 256K), so there is always room for more than language (actually two, I'll keep the keystroke language). BTW, the keystroke programming language is working well, 13 seconds to generate the Mandelbrot set on a 128x64 display with 20 iterations per pixel using doubles, and 7 seconds using floats and the floating-point coprocessor. At some stage I'll try the N queens program to see how well it performs compared to other calcs. Some pics I took while entering the above program: |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)