Declaring sketch identification
Contents
In order to be able to identify a sketch once it is loaded into the cable several fields of information can be embedded into the generated sketch code. For this purpose the following macro must be used:
RK002_DECLARE_INFO(app_name,app_author,app_version,app_guid)
As can be seen from the above definition, the macro takes 4 parameters:
- app_name = short text-string identifying the app (for example: “TESTAPP”)
- app_author = text-string identifying the author (for example “Retrokits, (info@retrokits.com)”)
- app_version = text-string identifying the version of the app (for example “1.0.0”)
- app_guid = text-string containing a globally unique identifier which can be used to uniquely identifying this app
(generate any GUID form here: https://www.guidgenerator.com)
The RK002 loader program is able to fetch & display this information from a running sketch.
example:
#include <RK002.h> RK002_DECLARE_INFO("SAMPLE CODE","duy@retrokits.com","1.0","7b47d3dd-991a-4197-ac02-d340cdabfb59") boolean RK002_onNoteOn(byte channel, byte key, byte velocity) { RK002_sendNoteOn(channel, key+7, velocity); return true; } boolean RK002_onNoteOff(byte channel, byte key, byte velocity) { RK002_sendNoteOff(channel, key+7, velocity); return true; } void setup() { } void loop() { }