NXTTouchPanel calculator

mindsensors is soon coming out with a very cool new product; a touch panel overlay for the NXT screen. Deepak sent me one to beta test (big thank you!), so right away I started programming with it. I started out with the basics of reading the X and Y positions, and then started making virtual blocks on the screen I could “click” on. I wanted something more than just a grid where the segments turned black when I touched them, so I started programming the NXT to be a calculator.

It really isn’t anything fancy as far as calculators go, but it has the potential to be a lot more than it is right now.

So far, the calculator supports things as follows:
– C (clear out the values).
– 12*5+3-5/3 (operations right on top of the last one). It displays the results as it goes. So, you press 1, it displays 1, you press 2, it displays 12, you press *, it displays 12 and also indicates you pressed *, you press 5, it displays 5, you press +, it displays 60 and also indicates you pressed +…
– You can also do something like 10+16=+4/6 (where you press = in the middle to see the result before entering a new operator).
– You can do a totally different operation right after the first one like this 17-47=3+8 it will do the 17-47, and when you press =, it will give the answer. Then, since you enter a number next (3), it does the same thing as clearing it before the 3+8.

For the future:
– Add a <- for un-entering a digit or operator
– Add parentheses support
– Add decimal point support (the variables already support it, just not the display or buttons)
– Add more advanced math functions (like trig)
– Add shortcut for PI
– Make a scrolling menu for more room for buttons

This entry was posted in Mindsensors, Mindstorms, NXC, NXT and tagged , , , , . Bookmark the permalink.

2 Responses to NXTTouchPanel calculator

  1. bubby121 says:

    were did you get that sensor. How do you program it. and how much is it?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s