Musings and comments about our common interest
The latest HP Prime firmware has introduced several important features, which were lacking in previous releases and that allow to better use the machine resources.
Here we will discuss the drop-down menus and the screen tab menus. This makes communicating with your program much more seamless, GUI-oriented, than the typical question/answer and input field method (that we had to use if we didn’t have access to a Prime SDK (software development kit)
Both need some event-management concepts beforehand. An event is either a key click, or a mouse event. Mouse events can be of several types: click, long click, drag, etc., but we will now concentrate on the simple mouse click, in order to get up and running a short application (this program has been modified from one published by Eddie B. Shore, as many here). We have included some comments so that you can see what’s happening.
We will now focus on the screen tab menus and leave the dropdown menus for tomorrow:
// CAS Custom Menu
// EWS 2014–04–20
LOCAL m,m1,mx,my; //variables containing the mouse event and coordinates
WHILE MOUSE(1)≥0 DO END;
TEXTOUT_P(“Choose the function.”,1,1,4);
TEXTOUT_P(“Here you could put a description of the menu functions below”,1,18,4);
UNTIL SIZE(m1)>0; //Waiting until the Mouse variable is filled with a mouse event
mx:=m1(1); //Getting the coordinates of such event - first X
my:=m1(2); //Then y
IF my≥220 AND my≤239 THEN //Only if the mouse event in in the lower part of the screen
IF mx≥0 AND mx≤51 THEN
IF mx≥53 AND mx≤104 THEN
RETURN; //your code here;
IF mx≥106 AND mx≤157 THEN
RETURN ; //your code here;
IF mx≥159 AND mx≤210 THEN
RETURN; //your code here;
IF mx≥212 AND mx≤263 THEN
RETURN; //your code here;
IF mx≥265 AND mx≤319 THEN
RETURN; //your code here;
I had not realized that the stock level for HP41c repair kit was at zero again! But we have reordered and we have again 12 units in stock.
As there were a lot of problems with the transport methods for this product, we have decided to have it included in the price. Therefore, from now on shipping is included in the price, and there are no more hassles when the system proposes an expensive shipping method (while it could always be changed to registered letter, once the user had logged in)
Good luck with your HP41c repairs!
Here are some tips in order to have a lasting, quality battery bay repair:
My elder son is beginning to enjoy maths! At 12 years old, he is fond of reading, and he has considered several possible future professions, all related with writing and reading: journalist, novel writer, actor, etc. But now that he has enjoyed a good teacher, that makes maths learning fun (basically by giving them homework that is based on investigation: he gives a general problem, and as you solve a question, other questions come that make you think and discover relations and laws by yourself), then he is beginning to enjoy maths.
What he hates (as I did and still do) is the mechanical part of maths. One of the problems of last week was to check which prime numbers below 100 could be expressed as the sum of two squares. While he has learn to check for “prime-ness” by himself, it is tiring to apply it to many numbers. Then I took the opportunity to show him some of the possibilities of the HP Prime CAS mode: the ifactor() function. This function gives the prime factors of an integer; for example, ifactor(60) would return 22*3*5; so, an integer is a prime number if there is a single factor. This speeds a lot the search!
Other concepts that were explained too were gcd and lcm; and it was explained using numbers in its factored form; here he could use the lcm() and gcd() functions once he had apprehended the concepts on the factored numbers, in order to test his results. Then the calculator is really a tool to learn faster, not to cheat on the learning process.
Another alternative that I could have used was the hp50g, or even the hp41cl running any of the Sandmath modules (this is what I use!), but a touch screen is difficult to fight against for a 12 year old kid. The fact that he can download some games written in HP basic helps too. The games are quite lame when compared with what he can get in a simple smartphone; but the beauty of them is that he can enter in the program and try to understand what it is doing; alter number of lives, speed, number of enemies or even their aspect by modifying their grobs; and learn some programming in the process. In that respect, HP basic is much more readable than RPL, and more adequate to write games too.
(For a good load of games for you HP Prime, visit hpcalc.org/prime/games or en.hpprime.club. Some of them are fun enough, and it is surprising how fast can the HP Prime be)
We discussed a couple of days ago about the formula library designed by Eddie B. Shore. I have added several equations on my own - namely all the decibel-watt and decibel-voltage gain calculations, loudspeaker sensitivity; but do you have equations you want to have included?
Also, it is good practice to include the equation in the “print” area, so you know what the equation does before using the solver. Tomorrow I will post the program with this latter change - but also a couple of additional equations too.
I have found that some equations that worked in the HP17bII solver don’t work in the Prime’s. “Bad guess”, the system says. Go figure. The function is not linear by any means - it has a MIN() function, but nevertheless the variable usually searched for is outside of that MIN() function, so there should be no problem. Worthy of more investigation.
Due to the complexity of getting the right shipment option for the hp41c battery repair kit (it depends on the stage you are in the order), we have decided to increase the price a little and include the shipping cost in it. This is particularly beneficial for those out of the European Union, since they save also VAT.
Now the ordering should be much easier. Orders have begun to come in, so it must be working better than before!
On another subject: during this week end, we assembled 2 new JP 41CL with the latest circuit, including the new modules from Systemyde and Angel Martin (namely the HP16c function set clone). So, there are now 1 tall keys, satin-keyboard HP41c and 2 low keys, rugged keyboard HP41c. On demand, we could assemble too an HP41c - but personally I have always preferred the white border of the c models than the yellow of the CV or CX. Screen and keyboard are top-notch in all cases. No original box available, sorry!
There are also two Time modules available, one with English manual, and the other with French manual and original box. These are sold at 120 € if demanded with any of the HP41CLs, 150 € otherwise.
(As a comment aside, some customers complain that they can find some items cheaper in internet - but please compare apples with apples: our products bear 21% VAT on the sales price, provided that the customer sits in the European Union - hence a significant difference! Most second-hand dealers in the action sites don't charge VAT (and don't pay charge VAT to their tax administration!)
Sometimes a calculator has two users (typically a couple of brothers - not everyone can afford having two 150 € calculators in the same household for high school children), or there are times where you want to use some user settings, and in other case you want different settings. A question comes: how can settings can be stored or changed?
Settings are stored in different system variables, but not located in a single multi-variable set (list, matrix or string). The solution would imply putting all system variables in one of the above sets, and keep it there for further retrieval.
I have seen such program in hpmuseum.org, written by user Tyann. Here are the two programs required: one to store the current setting - the other to retrieve it later.
//HVars is a list of HOME user defined variables. Handle, Format, etc. are the system settings in Home
Today I would like to draw your attention to a small HP Prime site. Small but very well thought out. I could find elsewhere all that information, but it is very well organized.
The site is:
(There is a Russian version too, but 95% of our readers would feel better with the English one)
It has a very good command reference tool. In the DOCs area, apart from the manuals that you can find here, with their latest versions (by the way, I have updated the versions in our site too, to the 2015 versions), you can find all commands, both one by one or in a long list. It takes you to a very good command definition, where you can even post comments. This is the part I am now using most. Far better than perusing the long manuals!
There is also an area with customer apps. There are many games - I will have to put some in my children’s calls to get them interested. Some of them were from when we were young - very young. It will be also a good way to learn Prime programming.
There is also a software area, where the most recent firmware, communication tool and emulator are posted. For us Mac users, there is also a calculator for MacOs, based on Wine. I am now opening it and downloading the latest firmware upgrade. I’ll tell you how it works!
I loaded Eddie Shore’s Equation program in my HP Prime, tested it, and liked it a lot. There are a couple of things that could be improved, but it would require more work. But the program is very simple and good to go through and learn how easy is to achieve things in HP Prime with simple, easy to understand programs.
Let’s go through it together, and learn a couple of things meanwhile:
// March-April 2015 EWS
// Equation Library Similar to HP 48 series
// Variables A-Z & θ are global
(Eddie didn’t use the #pragma instruction since it wasn’t available at the time he wrote the program. I have already had some problems with it due to that - but that’s an easy fix. Just remember to place it at the very beginning of the file.
Then he initializes some local variables, that will be used for the menu choices. After that, he starts the solve app - since you could be anywhere else.)
// Main Menu
“Angle of Incidence”,
IF ch==0 THEN KILL; END;
This instruction creates a menu on the screen, gives it a title, lays down the choices, and stores the choice in the variable ch.
// 1 Geometry Loop
IF ch==1 THEN
“Surface Area: Sphere”,
“Surface Area: Cylinder”,
“Distance of 2 Points”,
“Regular Polygon: Σ Angles”,
“Area: Regular Polygon”});
IF d==0 THEN KILL; END;
Then, choice after choice on menu 1, he does the same thing, but with a level two menu: you choose the equations you will use. Again, the choice is stored in a variable: d in this case. if clicked out of the menu, or escaped, you get zero and you’re out of the program.
// 1.1 Area: Circle
IF d==1 THEN
PRINT(“A = Area”);
PRINT(“R = Radius”);
Choice per choice, he stores the equation in the system variable E1 (which is the first equation in the solver). Then, prints on the screen the variables used. These will disappear when you click any key; and then you’re left with the solver. (Here is one of the improvements that could be done: we could print the formula after the variables used. I’ll do it on Monday night, when I have some time.
// 1.11 Area: Regular Polygon
IF d==11 THEN
PRINT(“A = Area”);
PRINT(“N = Number of Sides”);
PRINT(“S = Length of a Side”);
// Close out Geometry Loop
Let’s not forget this last end, to close the Geometry chapter loop!!
Finalizing, we have these two instructions, to display the solver using the formula we have set in E1:
// Display Solver
Check(1) selects the first formula in the current app, which is the solver. (Check(2) w ould have checked the second, and so on)
Starts a view of the current app. Redraw, is optional; if Redraw, is true (non 0), it will force a refresh for the view.
The view numbers are as follows:
Did you learn anything? I did.
If there is a problem with the HP Prime, it is the lack of software available for it for the different professional fields: finance, engineering, physics, etc. The calculator, while extremely powerful, and programmable in a much more user-friendly language than the elegant but complicated RPL, was intended for secondary education, with extension to university maths, due to its extensive CAS system. However, if you wanted to load a formula for any physics or engineering problem, you were out of luck - they had not been programmed before.
I have tried to put together some account sets in the solver app - but I am limited to 10 for each app I set for it; and the selection of functions, and its use, could be clearly improved.
I am now excited, since I have seen exactly what I was looking for. Eddie B. Shore has created an equation library with 47 different equations that can be loaded in the solver app, covering many categories:
I am now traveling, but I really look forward to get into my computer and load it in my Prime!
You can find the file with the program here:
To be honest with you, athough my HP41CL has the serial connector, I have never used it. I frear too much to block the calculator - and it is a quite expensive machine!
But I have read today in Monte Dalrymple's site that he is preparing a "Flashing the HP41CL for Dummies" document. That'll be ideal for those of us who are not microprocessor programmers like Monte, Diego and others! I look forward to be able to add more images to my system. The good thing is that you can know what's the latest module you have because you can test the modules based on the recording date in Monte's manual - the first missing will show "nonexistent" on your screen - and you need to load modules from that date on"