Computer Geek's Calculator for PocketCHIP


NOTE: I fat-fingered the installation of supporting CA certs on my web server. I hope this didn’t throw anyone off. It is fixed now.

I have made a calculator for my PocketCHIP. As a roving computer geek I never know what I’m going to get into. As a software developer and tinkerer of digital hardware I frequently need to do boolean algebra. When I’m working on networks or servers I usually need to do network related math… which is boolean algebra on numbers formatted differently. So I’ve put together a calculator with an initial subset of my wish list and formatted the screen to fit the PocketCHIP. This app can also be used on a regular CHIP with the GUI OS installed.

This app has become like an additional appendage to me so I thought I’d share. Its free for use on any CHIP / PocketCHIP. Here’s a screen grab:


I’ve setup a repository that apt-get can pull from and created a script to install the repository’s public key and “sources.list” entry. Then it runs “apt-get update” followed by “apt-get install xc”. The actual executable and package name is “xc”, meaning: “X windows Calculator”. Not very imaginative but quick to type. :slight_smile:

So if your game to try it out put this script on your CHIP/PocketCHIP and run it as root: (2.0 KB)

sudo sh

Should suffice to do all of the setup and load it onto your device. The “xc” package also recognizes @marshmallow’s pocket-home and will add a launcher icon to your home screen. You’ll have to restart pocket-home to see the icon (ie. reboot). The start menu of the CHIP’s GUI will have the calculator in the “accessories” submenu. Its titled “Computer Geek’s Calculator”. Lastly it can be launched with the command “xc” in the terminal, or on the CHIP GUI in the “run program” dialog.

There are some unusual features so I encourage you to read the help file, especially the stuff about keyboard use. The help viewer is “docview” from the fpGUI project. Its actually in a separate package, since I’ve started to use it for all of my tech info collecting. I probably will use it in additional CHIP related projects and didn’t want to have multiple copies laying around. “apt-get” takes care of auto-installing it.

If you prefer not to use the repository and manually install the packages or just want to know more about the gory details of my delivery mechanism you can head over to my website.

If you want to uninstall it you can do the following:

sudo dpkg -P xc docview
sudo rm /etc/apt/sources.list.d/jfp_pc_free.list

The last line will remove the “apt” source if you used the installer script provided here. If you manually setup the apt source then you’ll need to manually clean it up, unless you may want to re-install it again.

In case anyone is interested: I wrote this with FreePascal v3.0.0 and fpGUI v1.4, with some of my own enhancements. The enhancements I’ve made have been merged into the “develop” branch of fpGUI… which really isn’t ready for use yet.

A portion of the development was done on the PocketCHIP and on a CHIP, connected to a projector for an approximate 8 foot by 6 foot monitor. :slight_smile:

I used “Yada”, which is a discontinued Perl script, for the Debian packaging. Unfortunately the Debian guys discontinued this tool. Its the only thing, that I’ve found, that brings some sanity to the Debian packaging process, which resemble a pot load scripts and tools bound together with random bits of bailing wire and bubblegum. The version I used shipped with Debian Lenny (v5). Since its a Perl script it will continue to run on any Debian based system until the package building system or Perl changes enough to break it.

Please use this topic to report problems and suggestions. I’ll get a proper bug tracking system on my website as soon as I have time to evaluate and pick one.


Very nice, I have thought that pocket chip could be a great replacement for those ti calculators if only schools didn’t require them because of some reason.



Thank you, great job! I will install it on my Pchip because I’ve got no doubts it will be very useful for me too!


Looks interesting. I’ll have to check it out.


It might be easy but he doesn’t even provide install instructions to install the tarball I downloaded. I filed a bug report. I’m curious to see it in action.



Yeah… read that in the “docs” folder of the tarball. That doesn’t explain how to install the tarball I downloaded and inspected. It does tell me how to let some other tool (gem) pull a copy of unknown version from somewhere out there on the Internet and pollute my OS in unknown ways with it. I’m too paranoid for that.

In short: I don’t know Ruby. Don’t want to learn Ruby’s in-and-outs just to try this. And I want all software installed on my system cleanly managed with dpkg.

I just received a response from my bug report. But I’m out of goof-off time for today. I might give it a go some other day.


I don’t know how to use this calculator but I am really stoked to see super smart people like you creating things on the PocketChip! We are lucky to have you and your contributions on this forum.


Bummer! :worried: Did you read the on-line help? What calculations did you try? What’s the point of confusion? What can I do to make it more intuitive?


Sorry, I miscommunicated. I havn’t actually tried to set it up or run it. What I meant was I don’t understand what this type of calculator is needed for because it’s out of my area of expertise, but I’m impressed nonetheless. And glad to see smart people investing their time in the PocketCHIP. I’m a Front-End Engineer, so networking is out of my wheelhouse, although I take every opportunity to learn about it.


:open_mouth: Oh! I see. :smiley: Then I think I’m not communicating well enough either. Networking is just one small aspect of what its useful for. It provides standard floating point operations but specializes in the weird sorts of binary math and number conversions that programmers, hardware developers and other sorts of computer experts might use.

I was inspired by the early windoze calculator that had a “programmer” mode but then disappointed with lack of advancements (but I did give up on windoze w/ XP) and the plethora of calculator apps I had on my Android devices. The thing is that network math isn’t any different from the other types of boolean math used for other programming tasks. I figured one programmer’s calculator should do all.

So I set out to write something to scratch the many calculator itches I’ve had over the years. I also tried to write it as generically as possible, without any specific calculations in mind, to prevent arbitrary limitations. And this turned out to be a good start. I still have several other desires for it. But it already has many things I haven’t seen with others, most notably: rotates, not just shifts, 64bit integers, oodles of registers (value storage), a printer like tape you can pull values from, left and right aligned mask making functions.

When you mentioned “front end engineer” I immediately thought of websites, CSS, HTML and such. I’m not sure if that is the specific “front end” you’re referring to. But then it occurred to me this could easily convert hex RGB color codes to and from decimal, using the “16” (hex) and “IPv4” (dotted byte) display formats.

Poke the “16” mode, type in the full 6 digit hex code, poke “IPv4” and you will have the three respective decimal values separated by dots. You can just as easily go the other way by using “IPv4” mode to enter the decimal color values, separated by dots, in the CSS defined order (RGB) and then poke the “16” mode to get the hex equivalent. From there you could perform math on the values… but you would need to be wary of overflowing the bytes.


add 10 red subtract 12 green

And quite frankly this technique would work with any byte-packed values.

Plus you could take your PocketCHIP to lunch with a group and use it to split the tab. :slight_smile: The registers could be useful for storing each person’s portion to make it easier to figure out the final remainder. And you could save the registers and tape on the CHIP/PocketCHIP JIC. :wink:

In short its a calculator with a few more fun toys.


You’re right, by front-end engineer I did mean a web front-end engineer. That’s a neat trick, to convert hex color codes! Actually, years ago in another life when I was training to become a mortgage broker, this calculator would have been super helpful for calculating mortgage amortizations, etc.

You are truly full stack jafcobend!


For those of you who may be interested:

I have released a minor update to the calculator. I was sitting at a data center doing math with hard drive partitions which are natively defined in sectors. The original PC definition of a sector being half a KB (512 bytes). This means some numbers I was working with were rather large. It didn’t take long for me to want to edit values not just erase them. So you can now use backspace in the traditional way and it also perform as a “clear” when already at 0 or after a computation has happened.

To get the update you can either download the package from my website and install it or if you used my script or manually added my repo you can update with apt-get. For more install detail see my website.