Andre Hernandez
Published © MIT

Smart Gases Detector

System of early detection of gases in homes, with activation of extractors through MQTT, based on NXP's Rapid IoT Prototyping Kit.

AdvancedFull instructions provided10 hours217

Things used in this project

Hardware components

Rapid IoT Prototyping Kit
NXP Rapid IoT Prototyping Kit
×1
Adafruit Feather HUZZAH esp32
×2
RGB Diffused Common Cathode
RGB Diffused Common Cathode
×1
Fan or extractor
×1
Relay Module (Generic)
×1

Software apps and online services

NXP Rapid IoT Studio

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Drill Bits

Story

Read more

Schematics

Circuit #1

Circuit #2

Circuit #3

Circuit #3

Code

ESP32 Recv.ino

Arduino
Receive MQTT Code.
#include <WiFi.h>
#include <PubSubClient.h>
 
const char* ssid = "YOUR_SSID";
const char* password =  "YOUR_PWRD";
const char* mqttServer = "YOUR_MQTT_SERVER";
const int mqttPort = "YOUR_MQTT_PORT";
const char* mqttUser = "YOUR_MQTT_USER";
const char* mqttPassword = "YOUR_MQTT_PWRD";

float sensorValue= 0;        // value read from the pot
int counter=0;
int flag =0;
 
WiFiClient espClient;
PubSubClient client(espClient);

void callback(char* topic, byte* payload, unsigned int length) {
  String pay="";
  for (int i=0;i<length;i++) 
  {
    pay+=(char)payload[i];
  }
  Serial.print(pay);
  if(pay=="FAN ON")
  {
   digitalWrite(12,LOW);
   Serial.println("FAN ON"); 
  }
  else if (pay=="FAN OFF")
  {
   digitalWrite(12,HIGH); 
   Serial.println("FAN OFF"); 
  }
  Serial.println();
}
 
void setup() {
  pinMode(12,OUTPUT);
  digitalWrite(12,HIGH);
  Serial.begin(115200);
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }
 
  Serial.println("Connected to the WiFi network");
 
  client.setServer(mqttServer, mqttPort);
 
  while (!client.connected()) {
    Serial.println("Connecting to MQTT...");
 
    if (client.connect("ESP32Client2", mqttUser, mqttPassword )) {
 
      Serial.println("connected");
 
    } else {
 
      Serial.print("failed with state ");
      Serial.print(client.state());
      delay(2000);
 
    }
  }
  client.setCallback(callback);
  client.subscribe("esp/test");
}
 
void loop() {
  client.loop();
}

ESP32 Send.ino

Arduino
Send MQTT Code
#include <WiFi.h>
#include <PubSubClient.h>
 

const char* ssid = "YOUR_SSID";
const char* password =  "YOUR_PWRD";
const char* mqttServer = "YOUR_MQTT_SERVER";
const int mqttPort = "YOUR_MQTT_PORT";
const char* mqttUser = "YOUR_MQTT_USER";
const char* mqttPassword = "YOUR_MQTT_PWRD";

float sensorValue= 0;        // value read from the pot
int counter=0;
int flag =0;
 
WiFiClient espClient;
PubSubClient client(espClient);

void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  String pay="";
  Serial.println(pay);
  for (int i=0;i<length;i++) 
  {
    pay+=(char)payload[i];
  }
  Serial.print(pay);
  Serial.println();
}
 
void setup() {
 
  Serial.begin(115200);
  WiFi.begin(ssid, password);
 
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
  }
 
  Serial.println("Connected to the WiFi network");
 
  client.setServer(mqttServer, mqttPort);
 
  while (!client.connected()) {
    Serial.println("Connecting to MQTT...");
 
    if (client.connect("ESP32Client", mqttUser, mqttPassword )) {
 
      Serial.println("connected");
 
    } else {
 
      Serial.print("failed with state ");
      Serial.print(client.state());
      delay(2000);
 
    }
  }
  client.setCallback(callback);
  client.subscribe("esp/test2");
}
 
void loop() {
  client.loop();
    for(int i=0;i<100;i++)
  {
   sensorValue+= analogRead(A0);
   delayMicroseconds(500); 
  }

  sensorValue/=100;
  // map it to the range of the analog out:
  // change the analog out value:
    if (sensorValue< 800)
  {
     if (flag ==0)
    {
     client.publish("esp/test", "FAN OFF");  
    }
    flag=1;
   Serial.println(0);
   counter=0;
  }
  else if ((sensorValue>= 800) && (counter > 5))
  {
    if (flag==1)
    {
     client.publish("esp/test", "FAN ON");  
    }
    flag=0;
   Serial.println(sensorValue);
   
  }
  else
  {
    Serial.println(0);
    counter+=1;
  }
}

Air Monitor.atmo

JSON
Atmosphere Project
{
  "name": "Rapid IoT Kit Out Of Box Demo",
  "createVersion": "2017-08-12",
  "description": "Comprehensive demonstration of the capabilities of the NXP RapidIoT Development Kit. Includes reading from all onboard sensors as well as BLE & Thread support.",
  "lastModified": "2018-03-28T15:24:07.578Z",
  "created": "2018-03-28T15:24:07.578Z",
  "meta": {
    "projectTypeName": "NXP Rapid IoT",
    "projectTypeId": "NxpRpk"
  },
  "planes": {
    "NXP Rapid IoT": {
      "type": "mcuxpresso",
      "compilerVersion": "latest",
      "variants": [
        "NxpRpk"
      ],
      "meta": {},
      "elements": [
        {
          "name": "NFCOnOff",
          "type": "EmbeddedOnOffDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(NFCOnOff, x), ATMO_PROPERTY(NFCOnOff, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(NFCOnOff, pageHidden);\n    config.textColor = ATMO_PROPERTY(NFCOnOff, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(NFCOnOff, topRightButtonEnabled),\n\t\tATMO_PROPERTY(NFCOnOff,bottomRightButtonEnabled), ATMO_PROPERTY(NFCOnOff, topLeftButtonEnabled), ATMO_PROPERTY(NFCOnOff, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(NFCOnOff, x);\n    config.y = ATMO_PROPERTY(NFCOnOff, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(NFCOnOff, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(NFCOnOff, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(NFCOnOff, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(NFCOnOff, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(NFCOnOff, spanX);\n\tconfig.spanY = ATMO_PROPERTY(NFCOnOff, spanY);\n    config.title = ATMO_PROPERTY(NFCOnOff, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(NFCOnOff, titleHidden);\n    ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(NFCOnOff, persist), ATMO_PROPERTY(NFCOnOff, differentStartup));\n    ATMO_VARIABLE(NFCOnOff, pageHandle) = config.templateInstance;\n    ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(NFCOnOff,icon));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(NFCOnOff, initialValue));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(NFCOnOff, initialValue));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(NFCOnOff, offSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(NFCOnOff, onSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(NFCOnOff, offSetStartup));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(NFCOnOff, onSetStartup));\n    ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(NFCOnOff,pageHandle), 1, ATMO_ABILITY(NFCOnOff, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(NFCOnOff,pageHandle), 2, ATMO_ABILITY(NFCOnOff, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(NFCOnOff,pageHandle), 3, ATMO_ABILITY(NFCOnOff, topLeftButtonPressed));\n    ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(NFCOnOff,pageHandle), ATMO_ABILITY(NFCOnOff, onDisplayed));\n    ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(NFCOnOff, pageHandle));\n    return ATMO_Status_Success;\n    ",
              "setOff": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(NFCOnOff,pageHandle), 0, true);\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "setOn": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(NFCOnOff,pageHandle), 0, false);\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSet": "\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "onSet": "\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSetStartup": "\treturn ATMO_Status_Success;",
              "onSetStartup": "\treturn ATMO_Status_Success;"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "label": "string"
            },
            "codeUserChanged": {
              "onDisplayed": false,
              "setup": false,
              "setOff": false,
              "setOn": false,
              "offSet": false,
              "onSet": false,
              "valueChanged": false
            },
            "textColor": "GUI_RED",
            "pageTitle": "NFC",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "Toggle",
            "bottomLeftButtonEnabled": true,
            "x": "2",
            "y": "2",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings_nfc",
            "initialValue": false,
            "persist": true,
            "differentStartup": false
          },
          "meta": {
            "editorX": 435,
            "editorY": 364,
            "lastTrigger": "onSet"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "offSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "NfcOffFunc",
                "targetAbility": "trigger"
              }
            ],
            "setOn": [],
            "onSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "NfcOnFunc",
                "targetAbility": "trigger"
              }
            ],
            "offSetStartup": [],
            "onSetStartup": [],
            "valueChanged": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "setup": false,
            "setOff": false,
            "setOn": false,
            "offSet": false,
            "onSet": false,
            "offSetStartup": false,
            "onSetStartup": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
              "name": "onDisplayed",
              "triggers": [
                "onDisplayed"
              ]
            },
            {
              "name": "topRightButtonPressed",
              "triggers": [
                "topRightButtonPressed"
              ]
            },
            {
              "name": "bottomRightButtonPressed",
              "triggers": [
                "bottomRightButtonPressed"
              ]
            },
            {
              "name": "topLeftButtonPressed",
              "triggers": [
                "topLeftButtonPressed"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "setOff",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "setOn",
              "triggers": [
                "setOn"
              ]
            },
            {
              "name": "offSet",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "onSet",
              "triggers": [
                "onSet"
              ]
            },
            {
              "name": "offSetStartup",
              "triggers": [
                "offSetStartup"
              ]
            },
            {
              "name": "onSetStartup",
              "triggers": [
                "onSetStartup"
              ]
            }
          ]
        },
        {
          "name": "ThreadOnOff",
          "type": "EmbeddedOnOffDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(ThreadOnOff, x), ATMO_PROPERTY(ThreadOnOff, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(ThreadOnOff, pageHidden);\n    config.textColor = ATMO_PROPERTY(ThreadOnOff, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(ThreadOnOff, topRightButtonEnabled),\n\t\tATMO_PROPERTY(ThreadOnOff,bottomRightButtonEnabled), ATMO_PROPERTY(ThreadOnOff, topLeftButtonEnabled), ATMO_PROPERTY(ThreadOnOff, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(ThreadOnOff, x);\n    config.y = ATMO_PROPERTY(ThreadOnOff, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(ThreadOnOff, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(ThreadOnOff, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(ThreadOnOff, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(ThreadOnOff, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(ThreadOnOff, spanX);\n\tconfig.spanY = ATMO_PROPERTY(ThreadOnOff, spanY);\n    config.title = ATMO_PROPERTY(ThreadOnOff, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(ThreadOnOff, titleHidden);\n    ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(ThreadOnOff, persist), ATMO_PROPERTY(ThreadOnOff, differentStartup));\n    ATMO_VARIABLE(ThreadOnOff, pageHandle) = config.templateInstance;\n    ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(ThreadOnOff,icon));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(ThreadOnOff, initialValue));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(ThreadOnOff, initialValue));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(ThreadOnOff, offSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(ThreadOnOff, onSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(ThreadOnOff, offSetStartup));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(ThreadOnOff, onSetStartup));\n    ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(ThreadOnOff,pageHandle), 1, ATMO_ABILITY(ThreadOnOff, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(ThreadOnOff,pageHandle), 2, ATMO_ABILITY(ThreadOnOff, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(ThreadOnOff,pageHandle), 3, ATMO_ABILITY(ThreadOnOff, topLeftButtonPressed));\n    ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(ThreadOnOff,pageHandle), ATMO_ABILITY(ThreadOnOff, onDisplayed));\n    ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(ThreadOnOff, pageHandle));\n    return ATMO_Status_Success;\n    ",
              "setOff": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(ThreadOnOff,pageHandle), 0, true);\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "setOn": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(ThreadOnOff,pageHandle), 0, false);\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSet": "\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "onSet": "\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSetStartup": "\treturn ATMO_Status_Success;",
              "onSetStartup": "\treturn ATMO_Status_Success;"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "label": "string"
            },
            "codeUserChanged": {
              "onDisplayed": false,
              "setup": false,
              "setOff": false,
              "setOn": false,
              "offSet": false,
              "onSet": false,
              "valueChanged": false
            },
            "textColor": "GUI_GREEN",
            "pageTitle": "Thread",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "Join",
            "bottomRightButtonEnabled": true,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "Toggle",
            "bottomLeftButtonEnabled": true,
            "x": "1",
            "y": "2",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings_thread",
            "initialValue": false,
            "persist": true,
            "differentStartup": true
          },
          "meta": {
            "editorX": 435,
            "editorY": 266,
            "lastTrigger": "offSetStartup"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedNxpRpkThread",
                "targetAbility": "join"
              }
            ],
            "topLeftButtonPressed": [],
            "offSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThreadOffFunc",
                "targetAbility": "trigger"
              }
            ],
            "setOn": [],
            "onSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThreadOnFunc",
                "targetAbility": "trigger"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BluetoothOnOff",
                "targetAbility": "setOff"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThrRebootReqPage",
                "targetAbility": "displayPage"
              }
            ],
            "offSetStartup": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThreadOffFunc",
                "targetAbility": "trigger"
              }
            ],
            "onSetStartup": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BluetoothOnOff",
                "targetAbility": "setOff"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThreadOnFunc",
                "targetAbility": "trigger"
              }
            ],
            "valueChanged": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "setup": false,
            "setOff": false,
            "setOn": false,
            "offSet": false,
            "onSet": false,
            "offSetStartup": false,
            "onSetStartup": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
              "name": "onDisplayed",
              "triggers": [
                "onDisplayed"
              ]
            },
            {
              "name": "topRightButtonPressed",
              "triggers": [
                "topRightButtonPressed"
              ]
            },
            {
              "name": "bottomRightButtonPressed",
              "triggers": [
                "bottomRightButtonPressed"
              ]
            },
            {
              "name": "topLeftButtonPressed",
              "triggers": [
                "topLeftButtonPressed"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "setOff",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "setOn",
              "triggers": [
                "setOn"
              ]
            },
            {
              "name": "offSet",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "onSet",
              "triggers": [
                "onSet"
              ]
            },
            {
              "name": "offSetStartup",
              "triggers": [
                "offSetStartup"
              ]
            },
            {
              "name": "onSetStartup",
              "triggers": [
                "onSetStartup"
              ]
            }
          ]
        },
        {
          "name": "BluetoothOnOff",
          "type": "EmbeddedOnOffDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(BluetoothOnOff, x), ATMO_PROPERTY(BluetoothOnOff, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(BluetoothOnOff, pageHidden);\n    config.textColor = ATMO_PROPERTY(BluetoothOnOff, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(BluetoothOnOff, topRightButtonEnabled),\n\t\tATMO_PROPERTY(BluetoothOnOff,bottomRightButtonEnabled), ATMO_PROPERTY(BluetoothOnOff, topLeftButtonEnabled), ATMO_PROPERTY(BluetoothOnOff, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(BluetoothOnOff, x);\n    config.y = ATMO_PROPERTY(BluetoothOnOff, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(BluetoothOnOff, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(BluetoothOnOff, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(BluetoothOnOff, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(BluetoothOnOff, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(BluetoothOnOff, spanX);\n\tconfig.spanY = ATMO_PROPERTY(BluetoothOnOff, spanY);\n    config.title = ATMO_PROPERTY(BluetoothOnOff, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(BluetoothOnOff, titleHidden);\n    ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(BluetoothOnOff, persist), ATMO_PROPERTY(BluetoothOnOff, differentStartup));\n    ATMO_VARIABLE(BluetoothOnOff, pageHandle) = config.templateInstance;\n    ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(BluetoothOnOff,icon));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(BluetoothOnOff, initialValue));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(BluetoothOnOff, initialValue));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(BluetoothOnOff, offSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(BluetoothOnOff, onSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(BluetoothOnOff, offSetStartup));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(BluetoothOnOff, onSetStartup));\n    ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BluetoothOnOff,pageHandle), 1, ATMO_ABILITY(BluetoothOnOff, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BluetoothOnOff,pageHandle), 2, ATMO_ABILITY(BluetoothOnOff, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BluetoothOnOff,pageHandle), 3, ATMO_ABILITY(BluetoothOnOff, topLeftButtonPressed));\n    ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(BluetoothOnOff,pageHandle), ATMO_ABILITY(BluetoothOnOff, onDisplayed));\n    ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(BluetoothOnOff, pageHandle));\n    return ATMO_Status_Success;\n    ",
              "setOff": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(BluetoothOnOff,pageHandle), 0, true);\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "setOn": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(BluetoothOnOff,pageHandle), 0, false);\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSet": "\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "onSet": "\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSetStartup": "\treturn ATMO_Status_Success;",
              "onSetStartup": "\treturn ATMO_Status_Success;"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "label": "string"
            },
            "codeUserChanged": {
              "onDisplayed": false,
              "setup": false,
              "setOff": false,
              "setOn": false,
              "offSet": false,
              "onSet": false,
              "valueChanged": false
            },
            "textColor": "GUI_BLUE",
            "pageTitle": "Bluetooth",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "Toggle",
            "bottomLeftButtonEnabled": true,
            "x": "0",
            "y": "2",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings_bluetooth",
            "initialValue": true,
            "persist": true,
            "differentStartup": true
          },
          "meta": {
            "editorX": 447,
            "editorY": 140,
            "lastTrigger": "onSetStartup"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "offSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BtOffFunc",
                "targetAbility": "trigger"
              }
            ],
            "setOn": [],
            "onSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BtOnFunc",
                "targetAbility": "trigger"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThreadOnOff",
                "targetAbility": "setOff"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BleRebootReqPage",
                "targetAbility": "displayPage"
              }
            ],
            "offSetStartup": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BtOffFunc",
                "targetAbility": "trigger"
              }
            ],
            "onSetStartup": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "ThreadOnOff",
                "targetAbility": "setOff"
              },
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BtOnFunc",
                "targetAbility": "trigger"
              }
            ],
            "valueChanged": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "setup": false,
            "setOff": false,
            "setOn": false,
            "offSet": false,
            "onSet": false,
            "offSetStartup": false,
            "onSetStartup": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
              "name": "onDisplayed",
              "triggers": [
                "onDisplayed"
              ]
            },
            {
              "name": "topRightButtonPressed",
              "triggers": [
                "topRightButtonPressed"
              ]
            },
            {
              "name": "bottomRightButtonPressed",
              "triggers": [
                "bottomRightButtonPressed"
              ]
            },
            {
              "name": "topLeftButtonPressed",
              "triggers": [
                "topLeftButtonPressed"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "setOff",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "setOn",
              "triggers": [
                "setOn"
              ]
            },
            {
              "name": "offSet",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "onSet",
              "triggers": [
                "onSet"
              ]
            },
            {
              "name": "offSetStartup",
              "triggers": [
                "offSetStartup"
              ]
            },
            {
              "name": "onSetStartup",
              "triggers": [
                "onSetStartup"
              ]
            }
          ]
        },
        {
          "name": "Buzzer",
          "type": "EmbeddedOnOffDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(Buzzer, x), ATMO_PROPERTY(Buzzer, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(Buzzer, pageHidden);\n    config.textColor = ATMO_PROPERTY(Buzzer, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(Buzzer, topRightButtonEnabled),\n\t\tATMO_PROPERTY(Buzzer,bottomRightButtonEnabled), ATMO_PROPERTY(Buzzer, topLeftButtonEnabled), ATMO_PROPERTY(Buzzer, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(Buzzer, x);\n    config.y = ATMO_PROPERTY(Buzzer, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(Buzzer, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(Buzzer, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(Buzzer, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(Buzzer, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(Buzzer, spanX);\n\tconfig.spanY = ATMO_PROPERTY(Buzzer, spanY);\n    config.title = ATMO_PROPERTY(Buzzer, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(Buzzer, titleHidden);\n    ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(Buzzer, persist), ATMO_PROPERTY(Buzzer, differentStartup));\n    ATMO_VARIABLE(Buzzer, pageHandle) = config.templateInstance;\n    ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(Buzzer,icon));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(Buzzer, initialValue));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(Buzzer, initialValue));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(Buzzer, offSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(Buzzer, onSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(Buzzer, offSetStartup));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(Buzzer, onSetStartup));\n    ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(Buzzer,pageHandle), 1, ATMO_ABILITY(Buzzer, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(Buzzer,pageHandle), 2, ATMO_ABILITY(Buzzer, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(Buzzer,pageHandle), 3, ATMO_ABILITY(Buzzer, topLeftButtonPressed));\n    ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(Buzzer,pageHandle), ATMO_ABILITY(Buzzer, onDisplayed));\n    ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(Buzzer, pageHandle));\n    return ATMO_Status_Success;\n    ",
              "setOff": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(Buzzer,pageHandle), 0, true);\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "setOn": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(Buzzer,pageHandle), 0, false);\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSet": "\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "onSet": "\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSetStartup": "\treturn ATMO_Status_Success;",
              "onSetStartup": "\treturn ATMO_Status_Success;"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "label": "string"
            },
            "codeUserChanged": {
              "onDisplayed": false,
              "setup": false,
              "setOff": false,
              "setOn": false,
              "offSet": false,
              "onSet": false,
              "valueChanged": false
            },
            "textColor": "GUI_BLACK",
            "pageTitle": "Buzzer",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "Toggle",
            "bottomLeftButtonEnabled": true,
            "x": "3",
            "y": "2",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings_buzzer",
            "initialValue": true,
            "persist": true,
            "differentStartup": false
          },
          "meta": {
            "editorX": 493,
            "editorY": 452,
            "lastTrigger": "onSet"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "offSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedNxpRpkBuzzer",
                "targetAbility": "turnOff"
              }
            ],
            "setOn": [],
            "onSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedNxpRpkBuzzer",
                "targetAbility": "beep"
              }
            ],
            "offSetStartup": [],
            "onSetStartup": [],
            "valueChanged": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "setup": false,
            "setOff": false,
            "setOn": false,
            "offSet": false,
            "onSet": false,
            "offSetStartup": false,
            "onSetStartup": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
              "name": "onDisplayed",
              "triggers": [
                "onDisplayed"
              ]
            },
            {
              "name": "topRightButtonPressed",
              "triggers": [
                "topRightButtonPressed"
              ]
            },
            {
              "name": "bottomRightButtonPressed",
              "triggers": [
                "bottomRightButtonPressed"
              ]
            },
            {
              "name": "topLeftButtonPressed",
              "triggers": [
                "topLeftButtonPressed"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "setOff",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "setOn",
              "triggers": [
                "setOn"
              ]
            },
            {
              "name": "offSet",
              "triggers": [
                "offSet"
              ]
            },
            {
              "name": "onSet",
              "triggers": [
                "onSet"
              ]
            },
            {
              "name": "offSetStartup",
              "triggers": [
                "offSetStartup"
              ]
            },
            {
              "name": "onSetStartup",
              "triggers": [
                "onSetStartup"
              ]
            }
          ]
        },
        {
          "name": "AccelOnOff",
          "type": "EmbeddedOnOffDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(AccelOnOff, x), ATMO_PROPERTY(AccelOnOff, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "topRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "bottomRightButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "topLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(AccelOnOff, pageHidden);\n    config.textColor = ATMO_PROPERTY(AccelOnOff, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(AccelOnOff, topRightButtonEnabled),\n\t\tATMO_PROPERTY(AccelOnOff,bottomRightButtonEnabled), ATMO_PROPERTY(AccelOnOff, topLeftButtonEnabled), ATMO_PROPERTY(AccelOnOff, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(AccelOnOff, x);\n    config.y = ATMO_PROPERTY(AccelOnOff, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(AccelOnOff, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(AccelOnOff, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(AccelOnOff, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(AccelOnOff, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(AccelOnOff, spanX);\n\tconfig.spanY = ATMO_PROPERTY(AccelOnOff, spanY);\n    config.title = ATMO_PROPERTY(AccelOnOff, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(AccelOnOff, titleHidden);\n    ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(AccelOnOff, persist), ATMO_PROPERTY(AccelOnOff, differentStartup));\n    ATMO_VARIABLE(AccelOnOff, pageHandle) = config.templateInstance;\n    ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(AccelOnOff,icon));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(AccelOnOff, initialValue));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(AccelOnOff, initialValue));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(AccelOnOff, offSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(AccelOnOff, onSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(AccelOnOff, offSetStartup));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(AccelOnOff, onSetStartup));\n    ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(AccelOnOff,pageHandle), 1, ATMO_ABILITY(AccelOnOff, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(AccelOnOff,pageHandle), 2, ATMO_ABILITY(AccelOnOff, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(AccelOnOff,pageHandle), 3, ATMO_ABILITY(AccelOnOff, topLeftButtonPressed));\n    ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(AccelOnOff,pageHandle), ATMO_ABILITY(AccelOnOff, onDisplayed));\n    ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(AccelOnOff, pageHandle));\n    return ATMO_Status_Success;\n    ",
              "setOff": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(AccelOnOff,pageHandle), 0, true);\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "setOn": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(AccelOnOff,pageHandle), 0, false);\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSet": "\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "onSet": "\n    ATMO_CreateValueBool(out, true);\n    return ATMO_Status_Success;\n    ",
              "offSetStartup": "\treturn ATMO_Status_Success;",
              "onSetStartup": "\treturn ATMO_Status_Success;"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "label": "string"
            },
            "codeUserChanged": {
              "onDisplayed": false,
              "setup": false,
              "setOff": false,
              "setOn": false,
              "offSet": false,
              "onSet": false,
              "valueChanged": false
            },
            "textColor": "GUI_GREEN",
            "pageTitle": "Accelerometer",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "Toggle",
            "bottomLeftButtonEnabled": true,
            "x": "44",
            "y": "4",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_sensors_accmag",
            "initialValue": true,
            "persist": true,
            "differentStartup": false
          },
          "meta": {
            "editorX": 724,
            "editorY": 24,
            "lastTrigger": "offSet"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "offSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "FXOS8700AccelerometerMagnetometer",
                "targetAbility": "setDisabled"
              }
            ],
            "setOn": [],
            "onSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "FXOS8700AccelerometerMagnetometer",
                "targetAbility": "setEnabled"
              }
            ],
            "offSetStartup": [],
            "onSetStartup": [],
            "valueChanged": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "setup": false,
            "setOff": false,
            "setOn": false,
            "offSet": false,
            "onSet": false,
            "offSetStartup": false,
            "onSetStartup": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
...

This file has been truncated, please download it to see its full contents.

Credits

Andre Hernandez

Andre Hernandez

3 projects • 3 followers
I am a consultant for Deloitte in the IT department. I have always had passion for drone design and development.

Comments