Template

Table of contents

The Template example program is not as such a real program. Instead it is a template that you can use to start your own program without having to start everything from scratch. Of course you may still chose to do it just the way you want it. However, the Template example program may be a fast track from idea to upload.

The Template example program has four global variables called

  • myByte, that is an eight bit variable
  • myInt, that is a 32 bits integer variable
  • myDouble, that is an eight byte double variable
  • myStr, that is a ten character array intended to hold a nine character string and a zero (0) terminating character

When the Template example program is launched the above variables are loaded from the EEPROM and printed to the LCD. If the configuration is changed via the USB port the variables are saved to the EEPROM and printed to the LCD.

The EEPROM addresses, where the variables are stored, are defined in the config.h file. You can chose any EEPROM address you like but please be aware of potential conflicts with the EEPROM addresses in the other RFzero example programs.

Otherwise the program has no real functionality – but this is where you come into the picture by adding the decision flow you need in your own program.


Display

The display is a LCD, HD44780 20×4 parallel support only, that shows the myByte, myInt, myDouble and myStr variables and the GPS status and UTC seconds.

The LCD showing the GPS status and UTC seconds and the myByte, myInt, myDouble and myStr variables.


Configuration

The configuration of the program is done via the USB port, 9600 Baud, 8 bits, no parity and one stop bit, using a terminal program (e.g. Arduino IDE Serial Monitor, Termite Terminal (Windows), CuteCom (Linux) or Terminal (Mac OS) or the RFzero Manager (Windows)). Please connect the RFzero via a USB data cable to your computer and connect the terminal program to the right COM port in the terminal program. The RFzero identifies itself as an Arduino Zero (Windows Device Manager).

If you don’t see the RFzero> or RFzero config> prompts please press the enter key. When you want to execute a command you don’t have to enter the prompt but only the command and parameters after the >.

Changes to the configuration does not take effect before leaving the configuration mode.

All input to the RFzero must be in lowercase.

To enter the configuration mode please enter   config   at the RFzero> prompt, i.e.

RFzero> config

To see the available commands please enter   ?   at the RFzero config> prompt, i.e.

RFzero config> ?

To leave the configuration mode please enter   exit   at the RFzero config> prompt, i.e.

RFzero config> exit

When in configuration mode, i.e. when you see the RFzero config> prompt, the most frequent commands are

rd cfg

to see the configuration that will be used after exiting the configuration mode.

wr defaults

to set most of parameters to their default values. Please see the actual example program for the specific default values.

wr byt BYTE

where BYTE is value that goes into the myByte variable and EEPROM.

wr int INTEGER

where INTEGER is value that goes into the myInt variable and EEPROM.

wr dbl DOUBLE

where DOUBLE is value that goes into the myDouble variable and EEPROM.

wr str STRING

where STRING is value that goes into the myString variable and EEPROM.