Molencalc - a simple, engineer-friendly calculator

For a long while, i’ve wanted a little calculator to sit by my electronics bench and help out with the little calculations that come up - in a way that makes it not matter if “nF” should be “e-9” or “e-12”

So when PicoCalc came out, i knew i had to grab one and build it :smiley:

And here it is! GitHub - TheRealMolen/molencalc: an engineering calculator for picocalc

There’s still plenty i’d like to add – complex numbers, graphing, etc.

But i reckon it’s pretty handy the way it is already :slight_smile:

It’s based on the picocalc-text-starter (thanks @BlairLeduc!), and i’ve also built a little SDL-based “emulator”/testbed for faster iteration: GitHub - TheRealMolen/mcalc: graphical calculator for picocalc

12 Likes

Just released v15, with nice inline graphs :slight_smile:

3 Likes

This is great - the syntax of defining functions with f: and graphing with :g is new to me - is there documentation for this? Thank you very much.

Hey Bryn :slight_smile:

The syntax was originally a bit “vi-like” because it made the parsing a bit simpler, but i’ve just pushed v16 which removes the : from the beginnings of commands, and adds a much better help command.

I’ve also expanded the README so it now has some instructions on how to use things :slight_smile:

Please lmk if they’re helpful, or if there’s more clarity needed.

cheers – molen

This is VERY helpful, thanks! I was looking for a “help” and now you have it - great.

And I think the move to simpler syntax is also helpful (eg: “g” instead of “:g”), so to that end could I suggest that when defining a function, the “->” could be eliminated? Or perhaps replaced with “,” as in the graph command. That is, you are defining “f:” and the first argument is the “x” and the second arg is the y value as a function of that x, which in the graph command is delimited by a comma. Just a thought (I’m slow typing with that little keyboard!)

Also, and unusual thing. I tried “small” and found the lowercase “g” has an unusual graphical glitch. Almost like it is g prime g’ somehow.

Should these comments be made in your git project somehow, or is it okay to post here?

Thanks again, I will be using this.

I’m glad that was helpful :smiling_face:

I know what you mean about the syntax being fiddly to type - I often end up pressing z instead of SHIFT… Let me have a think on how to improve that!

Funnily enough I noticed that little glitch with the small g last night too. I need to dig through the binary data and find a bit to flip I think :grin:

1 Like

ok - i think v17 should hopefully make life a bit easier

You need to use the SHIFT key much less now (only really for + and *, and for the < when specifying axis ranges). You can use the [ and ] brackets instead of the ( ) ones.

Function and variable definitions are much simpler and are unified now - it’s just

> f[x]=sinc[x]
> theta = 3pi/2
1 Like

just released v18 with some fascinating animated plots of chaotic systems

2 Likes

I’ve just released v20, with a bunch of fixes and some nice quality-of-life things like edit history and a light theme

Enjoy!

2 Likes

Thank you fot this release.
Nevertheless, it seems to have a small problem on my pico2 : the results are printed out but immediately erased. Hard to see on a simple operation but more obvious on a graph.
I use the uf2 loader it that’s relevant.
f.

That doesn’t sound ideal!

I’ve been developing on a pico2, so that should be ok, but perhaps there’s a conflict with the uf2 loader. I’ll give it a try and see.

just in case it’s important, do you know which version of the main board bios you’re using? I’ve been testing with 1.6 but I know there are a few others around…

TBH I am not sure. I don’t remember what I did, and I think it’s v1.2. since that’s the only files I have on my disks, dated june 2025.
Do you know a way for me to see that release version easely ?

Unfortunately I’m not sure how you can easily tell which version is installed. It’s possible that there’s a way to find out – but updating it was quite a manual process, so if you don’t remember doing it, I imagine you have the stock install, which I believe is 1.2 or 1.4

I’ve just tested with a pico2 and uf2loader and it worked fine for me, so unless it’s the bios thing, i’m not really sure what it could be :frowning:

v20 did include quite a few changes to how I’m using the LCD - I believe I’m doing everything properly, but there is a small chance that my code is unwittingly doing something out-of-spec and I’m just getting lucky with my board.

I guess I’d recommend either trying to update your flash to 1.6, or sticking with v18 if that was working for you

There are instructions for upgrading flash here: PicoCalc/wiki/Setting-Up-Arduino-Development-for-PicoCalc-keyboard.md at master · clockworkpi/PicoCalc · GitHub

The bios itself is Picocalc_BIOS_v1.6.bin from here: PicoCalc/Bin at master · clockworkpi/PicoCalc · GitHub

I downloaded the firmware I installed from the stm32, it is the version 1.4
I am trying 1.6 in a few minutes and let you know asap.

j.

Ok, I just flashed BIOS_v1.6, same behaviour, :frowning:

j.

urk, that’s frustrating :frowning:

Do you see the same if you enter theme light into molencalc?

same thing with “theme light”

What seems to happen is the cursor Y position doesn’t get incremented, and the new cursor input has an Erase-to-EOS function that erases everything.
The problem seems to occur only when calc_process_input() is called, all other calls to text_emit_str() seems to work properly. Which doesn’t make any sense to me yet.

But no sweat, I’ll debug this further and get back to you with a better diagnostic later.
j.

That was fast :slight_smile:

I recompiled your app. With the uf2 generated locally it works.
So maybe the .uf2 file on github’s release page has a problem or I made a bad download ?

[edit] Note that your uf2 is 192000 bytes long, mine has 713216 bytes, I did not check the SDK version I am using very carefully so it could be anything in there …

Note also that I used your latest source, labelled v21 so maybe it’s different already.
J.

ah! there was a bug that I fixed in v21- perhaps that’s the same one you’re hitting.

if so, that’s great news and I just need to package up v21 properly :grin:

I’ve just pushed v21, which has a fix for a critical scrolling issue introduced in v20, as well as a few other lil refinements

thanks to @TheFlynn49 for help tracking down that issue!

1 Like