Code ID

A great feature of HITIPanel is the ability to identify the running program on your Arduino. To do this, you just need to assign a Code ID (name + version) to your Arduino code.

This example illustrates how to do this.

 

1) Sketch: 1_Basics \ 9_CodeID

We declare 2 strings to define the Code ID : a name and a version.

Both strings must be placed in the Program Memory by using "const ... PROGMEM" keywords (if you don’t know the meaning of this, it does not really matter, just put the keywords).

Finally, we set the Code ID by using HC_codeName() and HC_codeVersion().

#include <HITIComm.h>


// code ID
const char code_name[]    PROGMEM = "My great code";
const char code_version[] PROGMEM = "1.0.0";


// run once at power on
void setup()
{
    // initialize library
    HC_begin();

    // set code ID
    HC_codeName(code_name);
    HC_codeVersion(code_version);
}


// run repeatedly after setup()
void loop()
{
    // communicate with HITIPanel
    HC_communicate();
}

 

2) Arduino Toolbar

In the Arduino Toolbar, the Code ID appears once the communication is established with your Arduino.
image180.png

 

Was this article helpful?
0 out of 0 found this helpful