"Programming" Simple Aplets

Help Index

These notes are taken originally from a session presented at the STAWA conference (Science Teachers' Assoc. of W. Aust.) in May, 1997 and also at the MAWA conference (Maths Assoc. of W. Aust.) in Bunbury, Western Australia in August, 1997. It was written for the HP38G but users of more recent calculators will find it easy to follow.
It is possible to "program" the HP at different levels, depending on how computer literate you are. Listed by increasing difficulty, you can….
bulletCreate "Notes" to be stored in the Notes Catalogue which can contain course notes, homework, assignments etc. (NO PROGRAMMING REQUIRED.)
bulletCreate copies of the standard aplets which are preset with your chosen information.
For example...
bullet...you could create a copy of the Statistics aplet, load it with the data which you want the students to investigate, preset the axes to ‘nice’ values and finally add a small note telling them what to do. This could then be beamed to the class on the infrared link as homework for the weekend. (NO PROGRAMMING REQUIRED.)
bullet...you could create a copy of the Function aplet and set it up for an exercise that you know the students will be doing by pre-entering the equations and the axes. (NO PROGRAMMING REQUIRED.)
bulletCreate small stand-alone programs to perform tasks. For example, you might write a program to find the roots of a quadratic. (PROGRAMMING NEEDED)
bulletCreate modified aplets which are based on an existing aplet but also have extra properties which are ‘tied’ to the aplet via attached programs. These extra properties are accessed via the VIEWS menu, which you can totally control. (PROGRAMMING NEEDED)

Note: Extensive material on programming the HP can be found on my Help page.

Only the last two of these options require any programming knowledge at all and all of them are made vastly easier by the use of the ADK39 (Aplet Development Kit). Shown in the following pages are some examples using the Aplet Development Kit to perform the first two of the tasks mentioned above.

The ADK39 is a piece of free software created by HP and available from my Utilities page. This software, which only runs under Windows, allows you to design and modify your aplet or note on the PC and then download it to the calculator via the cable. If you have a 39g+, 39gs or 40gs then your cable came with the calculator. Otherwise you have to buy one. See the Hardware section of the Help page.

This web site also contains links to aplets that I have developed for the HP. These are free and can be downloaded and copied freely as long as you don’t try to sell them or pass them off as your own!

Before you start…

In each of these examples we will be using the Connectivity software to transfer the note/program/aplet created by the ADK39 onto the HP. It is very important that each of the notes, programs or aplets you create has its own directory. (Actually you can have a collection of notes in one directory if you are careful and experienced or lucky but I won't go into that here.)

The reason for this is that the Connectivity Kit looks for some special files called HPDIR39.000 and HPDIR39.CUR when it transfers files or aplets. These two files are sent to the HP and tell it what files it should expect in the transfer. If you don’t know what you’re doing then you can accidentally overwrite the files belonging to an old note when you create a new note.

Creating a Note

The simplest way to do this is to create a small 'dummy' note on the HP, upload it to the computer using the Connectivity software and then finish editing and composing it on the computer using the ADK39. When you are satisfied with the result then you can download it back to the HP.  One point worth remembering is that the Connectivity software saves all files (including notes) with an extension of .000  The ADK39, on the other hand, expects a note to have an extension of .NOT  When you use the File-Open command you may need to select the option of seeing All Files (*.*) before your note becomes visible. Once you've done this the first time the ADK39 will remember that setting.

Transferring to the HP

In the Help page you will find a reference to a number of pages that explain how to transfer information, aplets and notes from the calculator to the PC. The method differs slightly depending on which calculator you have because the software is different.

Creating copies of Standard aplets

Rather than simply a note, you may wish to send the students home with a set of data to analyze. This can be done by making a copy of the Statistics aplet, loading it with the data you require, setting the axes to display nicely and then transferring this prepared aplet to the students’ calculator via the infrared link. Any of the six standard aplets can be copied in this way.

[Library with 'Reset']Change into the APLET view (see right). Move the highlight to the Statistics aplet and press the RESET button to reset the aplet back to factory defaults. You don’t have to do this every time but it ensures that you will see the same things as my snapshots during this practice run.

[Save ApLet dialog]Now press the SAVE button and give the new aplet an appropriate name.
START the new aplet and load the data into the NUM view. Loading the data is one of the things that can’t be done in the ADK. Use the data shown below.


Table of Plant Growth for Days 1 to 9 of Experiment


1 2 3 4 5 6 7 8 9


2.35 3.00 4.15 5.45 7.15 9.40 12.55 16.00 21.70
Your NUM view should now look as shown left.

You now need to switch to bivariate data. This is controlled by the button (see left) labelled ‘1VAR’. If you press this button, it will change to read ‘2VAR’.

[PLOT SETUP view][PLOT SETUP view2]Change into the PLOT SETUP screen and set the axes to appropriate values. Mine are shown right.

[PLOT view]Pressing PLOT will show the data. Pressing the MENU button twice will clear the screen of everything but the graph.

You now need to change into the SYMB SETUP view and the SYMB view in order to specify what type of regression curve is to be fitted to the data. I decided to setup up for both a linear fit and and exponential fit (see right).[SYMB SETUP view][SYMB view] My worksheet would then discuss which was appropriate.

Presumably you know that to find the actual values for the curve fit, you change into the PLOT view and press the FIT button.  Do not do this!!
If you do, then these values will be shown on the copy that you send to the students and this will spoil their fun. If you slipped, just move the highlight onto the appropriate equation in the SYMB view and press the DEL key then re-CHK the data set.

If you now switch back to the APLET view, our aplet is now ready to be sent to the students using the infrared link (press SEND).


bulletIf you want to remove the aplet later, move the highlight to it in the APLET view and press the DEL button.
bulletIf you want to add a Note to the aplet then the easiest way to do it is while it is still on the calculator.
There are two types of notes; independent ones stored in the Notepad (SHIFT 0) and ones attached to the aplet (SHIFT NOTE). If you write in the attached note then it will be transmitted with the aplet when you send it to the students.
If your note is extensive then you can do it on the PC.
bulletCreate a directory for the aplet on the PC and use the Connectivity Software to copy it into this directory. The HP will ask if it is Ok to initialize the directory. This just means that it wants to create the special HPDIR files mentioned earlier, not that it wants to reformat your hard drive, so don’t panic.
bulletSEND the aplet to the PC and close the Connectivity Software.
bulletRun the ADK39 and use it to open the aplet. If you called your aplet ‘Plant Growth’ then you will find it stored in a file called PLANTGRO.000
bulletThe aplet will open showing its Note view. Type in your notes, save the aplet and close the ADK39.
bulletTransfer it back to the HP using the Connectivity Software. The note you just created is not one of the ‘independent’ notes that are are stored in the Notepad view but one that exclusively belongs to that aplet. You view this note by STARTing the aplet and then pressing the SHIFT NOTE button (above the APLET button).
Last modified: 19 Dec 2007                                             Sitemap        Home        Contact Me