Timothy Thomas
Published © MIT

Air Quality Data Logger For Better Environment

An Air Quality Logger Created using BalenaFin

IntermediateFull instructions provided6 hours574
Air Quality Data Logger For Better Environment

Things used in this project

Hardware components

balenaFin
balenaFin
×1
Rapid IoT Prototyping Kit
NXP Rapid IoT Prototyping Kit
×1
SORACOM Air Global IoT SIM
SORACOM Air Global IoT SIM
×1
Huawei MS2131 USB Modem
×1

Software apps and online services

Atmosphere IoT Studio

Story

Read more

Code

InfluxDB.py

Python
Python code used for sending data from Rapid IoT Kit to the InfluxDB via BalenaFin
import sys
import binascii
import struct
import time
from bluepy.btle import UUID, Peripheral
from influxdb import InfluxDBClient
import datetime
import logging

def persists(measurement, value):
    json_body = [
        {
            "measurement": measurement,
            "tags": {
                "ble_address" : sys.argv[1]
            },
            "time": datetime.datetime.utcnow().isoformat(),
            "fields": {
                "value": value
            }
        }
    ]
    logging.info(json_body)
    influx_client.write_points(json_body)


logging.basicConfig(level=logging.INFO)
influx_client = InfluxDBClient('localhost', 8086, database='TVOC_CO2')

service_uuid = UUID("1c937954-8c8e-433b-b06d-2ec5ad18ca9c")
char_TVOC_uuid = UUID("1c937954-8c8e-433b-b06d-2ec5ad18ca9d")
char_CO2_uuid = UUID("1c937954-8c8e-433b-b06d-2ec5ad18ca9e")

if len(sys.argv) != 2:
    print("Fatal, must pass device address:", sys.argv[0], "<device address="">")
    quit()

p = Peripheral(sys.argv[1])
print("Connected")

#for service in p.getServices():
#    print(service.uuid)

ButtonService=p.getServiceByUUID(service_uuid)
print("Got service")
try:
    ch_TVOC = ButtonService.getCharacteristics(char_TVOC_uuid)[0]
    ch_CO2 = ButtonService.getCharacteristics(char_CO2_uuid)[0]

    print("Fetched Characteristics")
    while 1:
        print("read")
        TVOCVal = struct.unpack('<f', ch_TVOC.read())[0]
        CO2Val = struct.unpack('<f', ch_CO2.read())[0]

        print (TVOCVal)
        print (CO2Val)
     
        persists("Air TVOO", TVOCVal);
        persists("CO2", CO2Val);

        time.sleep(1)

finally:
    p.disconnect()

AirQualityLogger.bin

AsciiDoc
Firmware File for Rapid IoT Kit
No preview (download only).

Atmosphere Studio Project

JSON
{
  "name": "Air Quality Logger",
  "createVersion": "2020-24-01",
  "description": "Air Quality Logger\nCopyright 2019 - ElectronicsVille Foundation",
  "lastModified": "2020-02-10T17:54:00.634Z",
  "created": "2020-02-10T17:54:00.634Z",
  "meta": {
    "projectTypeName": "NXP Rapid IoT",
    "projectTypeId": "NxpRpk"
  },
  "planes": {
    "NXP Rapid IoT": {
      "type": "mcuxpresso",
      "compilerVersion": "latest",
      "variants": [
        "NxpRpk"
      ],
      "meta": {},
      "elements": [
        {
          "name": "EmbeddedNxpRpkUserButtons",
          "type": "EmbeddedNxpRpkUserButtons",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\n    ATMO_MK64F_GPIO_EnableResetCombo(ATMO_PROPERTY(EmbeddedNxpRpkUserButtons, enableResetCombo));\n    ATMO_MK64F_GPIO_EnableDisplayToggleCombo(ATMO_PROPERTY(EmbeddedNxpRpkUserButtons, enableDisplayToggleCombo));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW1_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, topRightPushed));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW2_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, bottomRightPushed));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW3_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, topLeftPushed));\n    ATMO_MK64F_UserButton_RegisterAbilityHandle(ATMO_MK64F_SW4_Pushed, ATMO_ABILITY(EmbeddedNxpRpkUserButtons, bottomLeftPushed));\n\treturn ATMO_Status_Success;\n\t",
              "topRightPushed": "\n\treturn ATMO_Status_Success;\n    ",
              "bottomRightPushed": "\n\treturn ATMO_Status_Success;\n    ",
              "topLeftPushed": "\n\treturn ATMO_Status_Success;\n    ",
              "bottomLeftPushed": "\n\treturn ATMO_Status_Success;\n    "
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "topRightPushed": false,
              "bottomRightPushed": false,
              "topLeftPushed": false,
              "bottomLeftPushed": false
            },
            "enableResetCombo": true,
            "enableDisplayToggleCombo": true
          },
          "meta": {
            "editorX": 73,
            "editorY": 26,
            "lastTrigger": "bottomLeftPushed"
          },
          "triggers": {
            "triggered": [],
            "topRightPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "processTopRightButton"
              }
            ],
            "bottomRightPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "processBottomRightButton"
              }
            ],
            "topLeftPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "processTopLeftButton"
              }
            ],
            "bottomLeftPushed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "processBottomLeftButton"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "topRightPushed": false,
            "bottomRightPushed": false,
            "topLeftPushed": false,
            "bottomLeftPushed": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "topRightPushed",
              "triggers": [
                "topRightPushed"
              ]
            },
            {
              "name": "bottomRightPushed",
              "triggers": [
                "bottomRightPushed"
              ]
            },
            {
              "name": "topLeftPushed",
              "triggers": [
                "topLeftPushed"
              ]
            },
            {
              "name": "bottomLeftPushed",
              "triggers": [
                "bottomLeftPushed"
              ]
            }
          ]
        },
        {
          "name": "SX9500Touch",
          "type": "EmbeddedSX9500",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\tATMO_SX9500_Config_t config;\n\tconfig.address = ATMO_PROPERTY(SX9500Touch, i2cAddress);\n\tconfig.i2cDriverInstance = ATMO_PROPERTY(SX9500Touch, i2cInstance);\n\tconfig.gpioDriverInstance = ATMO_PROPERTY(SX9500Touch, gpioInstance);\n\tconfig.interruptEnabled = ATMO_PROPERTY(SX9500Touch, interruptEnabled);\n\tconfig.interruptPin = ATMO_PROPERTY(SX9500Touch, interruptGpio);\n\tATMO_SX9500_Init(&config);\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Up, ATMO_ABILITY(SX9500Touch, pressUp));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Down, ATMO_ABILITY(SX9500Touch, pressDown));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Left, ATMO_ABILITY(SX9500Touch, pressLeft));\n\tATMO_SX9500_RegisterTouchedAbilityHandle(SX9500_Touched_Right, ATMO_ABILITY(SX9500Touch, pressRight));\n\treturn ATMO_Status_Success;",
              "getTouchData": "",
              "pressUp": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
              "pressDown": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
              "pressLeft": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;",
              "pressRight": "SX9500_TouchState_t touchState;\nATMO_GetBinary(in, &touchState, sizeof(touchState));\nATMO_CreateValueBinary(out, &touchState, sizeof(touchState));\nreturn ATMO_Status_Success;"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "getTouchData": false,
              "pressUp": false,
              "pressDown": false,
              "pressLeft": false,
              "pressRight": false
            },
            "i2cInstance": "ATMO_DRIVERINSTANCE_I2C_I2C2",
            "gpioInstance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
            "interruptEnabled": true,
            "interruptGpio": "PTA9",
            "i2cAddress": "0x28"
          },
          "meta": {
            "editorX": 72,
            "editorY": 163,
            "lastTrigger": "rightPressed"
          },
          "triggers": {
            "triggered": [],
            "touchDataRead": [],
            "upPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "navigateUp"
              }
            ],
            "downPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "navigateDown"
              }
            ],
            "leftPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "navigateLeft"
              }
            ],
            "rightPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "EmbeddedPageController",
                "targetAbility": "navigateRight"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "getTouchData": false,
            "pressUp": false,
            "pressDown": false,
            "pressLeft": false,
            "pressRight": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "getTouchData",
              "triggers": [
                "touchDataRead"
              ]
            },
            {
              "name": "pressUp",
              "triggers": [
                "upPressed",
                "touchDataRead"
              ]
            },
            {
              "name": "pressDown",
              "triggers": [
                "downPressed",
                "touchDataRead"
              ]
            },
            {
              "name": "pressLeft",
              "triggers": [
                "leftPressed",
                "touchDataRead"
              ]
            },
            {
              "name": "pressRight",
              "triggers": [
                "rightPressed",
                "touchDataRead"
              ]
            }
          ]
        },
        {
          "name": "EmbeddedPageController",
          "type": "EmbeddedPageController",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "setup": "\n\tATMO_UI_PAGE_CONTROLLER_Config_t config;\n\tconfig.enableUpDownNavLabels = ATMO_PROPERTY(EmbeddedPageController, upDownNavigationLabelsEnabled);\n\tconfig.enableLeftRightNavLabels = ATMO_PROPERTY(EmbeddedPageController, leftRightNavigationLabelsEnabled);\n\tATMO_UI_Page_SetConfiguration(&config);\n    return ATMO_Status_Success;\n\t",
              "displayRootPage": "\n\t\n\tATMO_UI_Page_DisplayRootPage();\n\treturn ATMO_Status_Success;\n\t",
              "navigateUp": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_UP);\n\treturn ATMO_Status_Success;\n\t",
              "navigateDown": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_DOWN);\n\treturn ATMO_Status_Success;\n\t",
              "navigateLeft": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_LEFT);\n\treturn ATMO_Status_Success;\n\t",
              "navigateRight": "\n\tATMO_UI_Page_ProcessNavButton(ATMO_UI_PAGE_NAV_RIGHT);\n\treturn ATMO_Status_Success;\n\t",
              "processTopRightButton": "\n\tATMO_UI_Page_ProcessUserButton(1);\n\treturn ATMO_Status_Success;\n\t",
              "processBottomRightButton": "\n\tATMO_UI_Page_ProcessUserButton(2);\n\treturn ATMO_Status_Success;\n\t",
              "processTopLeftButton": "\n\tATMO_UI_Page_ProcessUserButton(3);\n\treturn ATMO_Status_Success;\n\t",
              "processBottomLeftButton": "\n\tATMO_UI_Page_ProcessUserButton(4);\n\treturn ATMO_Status_Success;\n\t"
            },
            "variables": {},
            "embeddedPropertyConversions": {},
            "codeUserChanged": {
              "setup": false,
              "displayRootPage": false,
              "navigateUp": false,
              "navigateDown": false,
              "navigateLeft": false,
              "navigateRight": false,
              "processTopRightButton": false,
              "processBottomRightButton": false,
              "processTopLeftButton": false,
              "processBottomLeftButton": false
            },
            "upDownNavigationLabelsEnabled": true,
            "leftRightNavigationLabelsEnabled": true
          },
          "meta": {
            "editorX": 250,
            "editorY": 95,
            "lastTrigger": "triggered"
          },
          "triggers": {
            "triggered": [],
            "navigateUp": [],
            "navigateDown": [],
            "navigateLeft": [],
            "navigateRight": [],
            "processTopRightButton": [],
            "processBottomRightButton": [],
            "processTopLeftButton": [],
            "processBottomLeftButton": []
          },
          "interruptAbilities": {
            "trigger": false,
            "setup": false,
            "displayRootPage": false,
            "navigateUp": false,
            "navigateDown": false,
            "navigateLeft": false,
            "navigateRight": false,
            "processTopRightButton": false,
            "processBottomRightButton": false,
            "processTopLeftButton": false,
            "processBottomLeftButton": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "displayRootPage",
              "triggers": []
            },
            {
              "name": "navigateUp",
              "triggers": [
                "navigateUp"
              ]
            },
            {
              "name": "navigateDown",
              "triggers": [
                "navigateDown"
              ]
            },
            {
              "name": "navigateLeft",
              "triggers": [
                "navigateLeft"
              ]
            },
            {
              "name": "navigateRight",
              "triggers": [
                "navigateRight"
              ]
            },
            {
              "name": "processTopRightButton",
              "triggers": [
                "processTopRightButton"
              ]
            },
            {
              "name": "processBottomRightButton",
              "triggers": [
                "processBottomRightButton"
              ]
            },
            {
              "name": "processTopLeftButton",
              "triggers": [
                "processTopLeftButton"
              ]
            },
            {
              "name": "processBottomLeftButton",
              "triggers": [
                "processBottomLeftButton"
              ]
            }
          ]
        },
        {
          "name": "DisplayTVOC",
          "type": "EmbeddedIconLinesDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(DisplayTVOC, x), ATMO_PROPERTY(DisplayTVOC, y), false);\n\treturn ATMO_Status_Success;\n\t",
              "onDisplayed": "\n\treturn ATMO_Status_Success;\n    ",
              "onLeave": "\n\treturn ATMO_Status_Success;\n\t",
              "setIconLabelAndColor": "\n    struct {\n        char str[32];\n        GUI_COLOR color;\n    } icon_data;\n \n    ATMO_GetBinary(in, &icon_data, sizeof(icon_data));\n    ATMO_UI_ICONLINES_SetIconLabelColor(ATMO_VARIABLE(DisplayTVOC, pageHandle), icon_data.str, icon_data.color);\n    return ATMO_Status_Success;\n    ",
              "setIconLabel": "\n    char str[32];\n    ATMO_GetString(in, str, 32);\n    ATMO_UI_ICONLINES_SetIconLabel(ATMO_VARIABLE(DisplayTVOC, pageHandle), str);\n    return ATMO_Status_Success;\n    ",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n    config.hidden = ATMO_PROPERTY(DisplayTVOC, pageHidden);\n    config.textColor = ATMO_PROPERTY(DisplayTVOC, textColor);\n    config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(DisplayTVOC, topRightButtonEnabled),\n    ATMO_PROPERTY(DisplayTVOC,bottomRightButtonEnabled), ATMO_PROPERTY(DisplayTVOC, topLeftButtonEnabled), ATMO_PROPERTY(DisplayTVOC, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(DisplayTVOC, x);\n    config.y = ATMO_PROPERTY(DisplayTVOC, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(DisplayTVOC, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(DisplayTVOC, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(DisplayTVOC, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(DisplayTVOC, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(DisplayTVOC, spanX);\n\tconfig.spanY = ATMO_PROPERTY(DisplayTVOC, spanY);\n    config.title = ATMO_PROPERTY(DisplayTVOC, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(DisplayTVOC, titleHidden);\n\tATMO_UI_ICONLINES_Init(&config, ATMO_PROPERTY(DisplayTVOC, numLines), false);\n\tATMO_VARIABLE(DisplayTVOC, pageHandle) = config.templateInstance;\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 0, ATMO_PROPERTY(DisplayTVOC, line1Text));\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 1, ATMO_PROPERTY(DisplayTVOC, line2Text));\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 2, ATMO_PROPERTY(DisplayTVOC, line3Text));\n    ATMO_UI_ICONLINES_SetMainText(config.templateInstance, 3, ATMO_PROPERTY(DisplayTVOC, line4Text));\n    ATMO_UI_ICONLINES_SetIconLabel(config.templateInstance, ATMO_PROPERTY(DisplayTVOC, iconLabel));\n    ATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 1, ATMO_ABILITY(DisplayTVOC, topRightButtonPressed));\n\tATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 2, ATMO_ABILITY(DisplayTVOC, bottomRightButtonPressed));\n\tATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 3, ATMO_ABILITY(DisplayTVOC, topLeftButtonPressed));\n    ATMO_UI_ICONLINES_RegisterButtonAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), 4, ATMO_ABILITY(DisplayTVOC, bottomLeftButtonPressed));\n    ATMO_UI_ICONLINES_SetIcon(config.templateInstance, ATMO_PROPERTY(DisplayTVOC, icon));\n    ATMO_UI_ICONLINES_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(DisplayTVOC,pageHandle), ATMO_ABILITY(DisplayTVOC, onDisplayed));\n    ATMO_UI_ICONLINES_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(DisplayTVOC, onLeave));\n    return ATMO_Status_Success;\n    ",
              "setLine1Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 0, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "setLine2Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 1, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "setLine3Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 2, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    ",
              "setLine4Text": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_ICONLINES_SetMainText(ATMO_VARIABLE(DisplayTVOC,pageHandle), 3, label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return 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",
              "bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t"
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "iconLabel": "string",
              "line1Text": "string",
              "line2Text": "string",
              "line3Text": "string",
              "line4Text": "string"
            },
            "codeUserChanged": {
              "displayPage": false,
              "onDisplayed": false,
              "onLeave": false,
              "setIconLabelAndColor": false,
              "setIconLabel": false,
              "setup": false,
              "setLine1Text": false,
              "setLine2Text": false,
              "setLine3Text": false,
              "setLine4Text": false,
              "topRightButtonPressed": false,
              "bottomRightButtonPressed": false,
              "topLeftButtonPressed": false,
              "bottomLeftButtonPressed": false
            },
            "textColor": "GUI_BLACK",
            "pageTitle": "Air Quality",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "BK ON",
            "bottomRightButtonEnabled": true,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "BK OFF",
            "bottomLeftButtonEnabled": true,
            "x": 0,
            "y": 0,
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_applications_airq",
            "iconLabel": "",
            "numLines": "4",
            "line1Text": "TVOCs",
            "line2Text": "",
            "line3Text": "CO2",
            "line4Text": ""
          },
          "meta": {
            "editorX": 870,
            "editorY": 102,
            "lastTrigger": "topRightButtonPressed"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "onLeave": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BacklightOnOff",
                "targetAbility": "setOn"
              }
            ],
            "topLeftButtonPressed": [],
            "bottomLeftButtonPressed": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BacklightOnOff",
                "targetAbility": "setOff"
              }
            ]
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "onLeave": false,
            "setIconLabelAndColor": false,
            "setIconLabel": false,
            "setup": false,
            "setLine1Text": false,
            "setLine2Text": false,
            "setLine3Text": false,
            "setLine4Text": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "bottomLeftButtonPressed": false
          },
          "abilities": [
            {
              "name": "trigger",
              "triggers": [
                "triggered"
              ]
            },
            {
              "name": "displayPage",
              "triggers": []
            },
            {
              "name": "onDisplayed",
              "triggers": [
                "onDisplayed"
              ]
            },
            {
              "name": "onLeave",
              "triggers": [
                "onLeave"
              ]
            },
            {
              "name": "setIconLabelAndColor",
              "triggers": []
            },
            {
              "name": "setIconLabel",
              "triggers": []
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "setLine1Text",
              "triggers": []
            },
            {
              "name": "setLine2Text",
              "triggers": []
            },
            {
              "name": "setLine3Text",
              "triggers": []
            },
            {
              "name": "setLine4Text",
              "triggers": []
            },
            {
              "name": "topRightButtonPressed",
              "triggers": [
                "topRightButtonPressed"
              ]
            },
            {
              "name": "bottomRightButtonPressed",
              "triggers": [
                "bottomRightButtonPressed"
              ]
            },
            {
              "name": "topLeftButtonPressed",
              "triggers": [
                "topLeftButtonPressed"
              ]
            },
            {
              "name": "bottomLeftButtonPressed",
              "triggers": [
                "bottomLeftButtonPressed"
              ]
            }
          ]
        },
        {
          "name": "BacklightOnOff",
          "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(BacklightOnOff, x), ATMO_PROPERTY(BacklightOnOff, 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(BacklightOnOff, pageHidden);\n    config.textColor = ATMO_PROPERTY(BacklightOnOff, textColor);\n\tconfig.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(BacklightOnOff, topRightButtonEnabled),\n\t\tATMO_PROPERTY(BacklightOnOff,bottomRightButtonEnabled), ATMO_PROPERTY(BacklightOnOff, topLeftButtonEnabled), ATMO_PROPERTY(BacklightOnOff, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(BacklightOnOff, x);\n    config.y = ATMO_PROPERTY(BacklightOnOff, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(BacklightOnOff, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(BacklightOnOff, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(BacklightOnOff, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(BacklightOnOff, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(BacklightOnOff, spanX);\n\tconfig.spanY = ATMO_PROPERTY(BacklightOnOff, spanY);\n    config.title = ATMO_PROPERTY(BacklightOnOff, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(BacklightOnOff, titleHidden);\n    ATMO_UI_SELECTICON_Init(&config, 2, true, ATMO_PROPERTY(BacklightOnOff, persist), ATMO_PROPERTY(BacklightOnOff, differentStartup));\n    ATMO_VARIABLE(BacklightOnOff, pageHandle) = config.templateInstance;\n    ATMO_UI_SELECTICON_SetIcon(config.templateInstance, ATMO_PROPERTY(BacklightOnOff,icon));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 0, \"Off\", !ATMO_PROPERTY(BacklightOnOff, initialValue));\n    ATMO_UI_SELECTICON_SetOptionText(config.templateInstance, 1, \"On\", ATMO_PROPERTY(BacklightOnOff, initialValue));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(BacklightOnOff, offSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(BacklightOnOff, onSet));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 0, ATMO_ABILITY(BacklightOnOff, offSetStartup));\n    ATMO_UI_SELECTICON_RegisterOptionSelectedStartupAbilityHandle(config.templateInstance, 1, ATMO_ABILITY(BacklightOnOff, onSetStartup));\n    ATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), 1, ATMO_ABILITY(BacklightOnOff, topRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), 2, ATMO_ABILITY(BacklightOnOff, bottomRightButtonPressed));\n\tATMO_UI_SELECTICON_RegisterButtonAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), 3, ATMO_ABILITY(BacklightOnOff, topLeftButtonPressed));\n    ATMO_UI_SELECTICON_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(BacklightOnOff,pageHandle), ATMO_ABILITY(BacklightOnOff, onDisplayed));\n    ATMO_UI_SELECTICON_OverlaySaved(ATMO_VARIABLE(BacklightOnOff, pageHandle));\n    return ATMO_Status_Success;\n    ",
              "setOff": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(BacklightOnOff,pageHandle), 0, true);\n    ATMO_CreateValueBool(out, false);\n    return ATMO_Status_Success;\n    ",
              "setOn": "\n    ATMO_UI_SELECTICON_SetOption(ATMO_VARIABLE(BacklightOnOff,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": {
              "displayPage": false,
              "onDisplayed": false,
              "topRightButtonPressed": false,
              "bottomRightButtonPressed": false,
              "topLeftButtonPressed": false,
              "setup": false,
              "setOff": false,
              "setOn": false,
              "offSet": false,
              "onSet": false,
              "offSetStartup": false,
              "onSetStartup": false
            },
            "textColor": "GUI_BLACK",
            "pageTitle": "Backlight",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "Toggle",
            "bottomLeftButtonEnabled": true,
            "x": "1",
            "y": "3",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings_backlight",
            "initialValue": true,
            "persist": true,
            "differentStartup": false
          },
          "meta": {
            "editorX": 1010,
            "editorY": 72,
            "lastTrigger": "offSet"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "offSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BacklightOff",
                "targetAbility": "trigger"
              }
            ],
            "setOn": [],
            "onSet": [
              {
                "mapping": {},
                "targetOrder": [],
                "targetElement": "BacklightOn",
                "targetAbility": "trigger"
              }
            ],
            "offSetStartup": [],
            "onSetStartup": []
          },
          "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": "SettingsDisplay",
          "type": "EmbeddedIconLabelDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(SettingsDisplay, x), ATMO_PROPERTY(SettingsDisplay, 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",
              "bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n\tconfig.hidden = ATMO_PROPERTY(SettingsDisplay, pageHidden);\n\tconfig.textColor = ATMO_PROPERTY(SettingsDisplay, textColor);\n    config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(SettingsDisplay, topRightButtonEnabled),\n    ATMO_PROPERTY(SettingsDisplay,bottomRightButtonEnabled), ATMO_PROPERTY(SettingsDisplay, topLeftButtonEnabled), ATMO_PROPERTY(SettingsDisplay, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(SettingsDisplay, x);\n    config.x = ATMO_PROPERTY(SettingsDisplay, x);\n    config.y = ATMO_PROPERTY(SettingsDisplay, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(SettingsDisplay, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(SettingsDisplay, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(SettingsDisplay, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(SettingsDisplay, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(SettingsDisplay, spanX);\n\tconfig.spanY = ATMO_PROPERTY(SettingsDisplay, spanY);\n    config.title = ATMO_PROPERTY(SettingsDisplay, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(SettingsDisplay, titleHidden);\n\tATMO_UI_SINGLEICONTEXT_Init(&config);\n\tATMO_VARIABLE(SettingsDisplay, pageHandle) = config.templateInstance;\n    ATMO_UI_SINGLEICONTEXT_SetMainText(config.templateInstance, ATMO_PROPERTY(SettingsDisplay, label));\n    ATMO_UI_SINGLEICONTEXT_SetIcon(config.templateInstance, ATMO_PROPERTY(SettingsDisplay, icon));\n    ATMO_UI_SINGLEICONTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), ATMO_ABILITY(SettingsDisplay, onDisplayed));\n    ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 1, ATMO_ABILITY(SettingsDisplay, topRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 2, ATMO_ABILITY(SettingsDisplay, bottomRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 3, ATMO_ABILITY(SettingsDisplay, topLeftButtonPressed));\n    ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(SettingsDisplay,pageHandle), 4, ATMO_ABILITY(SettingsDisplay, bottomLeftButtonPressed));\n    ATMO_UI_SINGLEICONTEXT_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(SettingsDisplay, onLeave));\n\treturn ATMO_Status_Success;\n    ",
              "onLeave": "\n\treturn ATMO_Status_Success;\n\t",
              "setLabel": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_SINGLEICONTEXT_SetMainText(ATMO_VARIABLE(SettingsDisplay,pageHandle), label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    "
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
              "bottomRightButtonLabel": "string",
              "topLeftButtonLabel": "string",
              "bottomLeftButtonLabel": "string",
              "label": "string"
            },
            "codeUserChanged": {
              "displayPage": false,
              "onDisplayed": false,
              "topRightButtonPressed": false,
              "bottomRightButtonPressed": false,
              "topLeftButtonPressed": false,
              "bottomLeftButtonPressed": false,
              "setup": false,
              "onLeave": false,
              "setLabel": false
            },
            "textColor": "GUI_BLACK",
            "pageTitle": "Settings",
            "titleHidden": false,
            "pageHidden": false,
            "topRightButtonLabel": "",
            "topRightButtonEnabled": false,
            "bottomRightButtonLabel": "",
            "bottomRightButtonEnabled": false,
            "topLeftButtonLabel": "",
            "topLeftButtonEnabled": false,
            "bottomLeftButtonLabel": "",
            "bottomLeftButtonEnabled": false,
            "x": 0,
            "y": "1",
            "spanX": 1,
            "spanY": 1,
            "icon": "icon_settings",
            "label": ""
          },
          "meta": {
            "editorX": 71,
            "editorY": 292,
            "lastTrigger": "onDisplayed"
          },
          "triggers": {
            "triggered": [],
            "onDisplayed": [],
            "topRightButtonPressed": [],
            "bottomRightButtonPressed": [],
            "topLeftButtonPressed": [],
            "bottomLeftButtonPressed": [],
            "onLeave": []
          },
          "interruptAbilities": {
            "trigger": false,
            "displayPage": false,
            "onDisplayed": false,
            "topRightButtonPressed": false,
            "bottomRightButtonPressed": false,
            "topLeftButtonPressed": false,
            "bottomLeftButtonPressed": false,
            "setup": false,
            "onLeave": false,
            "setLabel": 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": "bottomLeftButtonPressed",
              "triggers": [
                "bottomLeftButtonPressed"
              ]
            },
            {
              "name": "setup",
              "triggers": []
            },
            {
              "name": "onLeave",
              "triggers": [
                "onLeave"
              ]
            },
            {
              "name": "setLabel",
              "triggers": []
            }
          ]
        },
        {
          "name": "InfoDisplay",
          "type": "EmbeddedIconLabelDisplay",
          "variants": [
            "embedded",
            "triggers",
            "abilities",
            "properties",
            "variables",
            "rpk"
          ],
          "properties": {
            "errorData": {},
            "code": {
              "trigger": "\treturn ATMO_Status_Success;",
              "displayPage": "\n\tATMO_UI_Page_DisplayPageByCoord(ATMO_PROPERTY(InfoDisplay, x), ATMO_PROPERTY(InfoDisplay, 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",
              "bottomLeftButtonPressed": "\n\treturn ATMO_Status_Success;\n\t",
              "setup": "\n    ATMO_UI_PAGE_Config_t config;\n\tconfig.hidden = ATMO_PROPERTY(InfoDisplay, pageHidden);\n\tconfig.textColor = ATMO_PROPERTY(InfoDisplay, textColor);\n    config.activeButtons = ATMO_UI_Page_GetButtonMask(ATMO_PROPERTY(InfoDisplay, topRightButtonEnabled),\n    ATMO_PROPERTY(InfoDisplay,bottomRightButtonEnabled), ATMO_PROPERTY(InfoDisplay, topLeftButtonEnabled), ATMO_PROPERTY(InfoDisplay, bottomLeftButtonEnabled));\n\tconfig.x = ATMO_PROPERTY(InfoDisplay, x);\n    config.x = ATMO_PROPERTY(InfoDisplay, x);\n    config.y = ATMO_PROPERTY(InfoDisplay, y);\n\tstrncpy(config.topLeftButtonLabel, ATMO_PROPERTY(InfoDisplay, topLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.topRightButtonLabel, ATMO_PROPERTY(InfoDisplay, topRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomLeftButtonLabel, ATMO_PROPERTY(InfoDisplay, bottomLeftButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n\tstrncpy(config.bottomRightButtonLabel, ATMO_PROPERTY(InfoDisplay, bottomRightButtonLabel), ATMO_BUTTON_LABEL_MAXLEN);\n    config.spanX = ATMO_PROPERTY(InfoDisplay, spanX);\n\tconfig.spanY = ATMO_PROPERTY(InfoDisplay, spanY);\n    config.title = ATMO_PROPERTY(InfoDisplay, pageTitle);\n    config.titleHidden = ATMO_PROPERTY(InfoDisplay, titleHidden);\n\tATMO_UI_SINGLEICONTEXT_Init(&config);\n\tATMO_VARIABLE(InfoDisplay, pageHandle) = config.templateInstance;\n    ATMO_UI_SINGLEICONTEXT_SetMainText(config.templateInstance, ATMO_PROPERTY(InfoDisplay, label));\n    ATMO_UI_SINGLEICONTEXT_SetIcon(config.templateInstance, ATMO_PROPERTY(InfoDisplay, icon));\n    ATMO_UI_SINGLEICONTEXT_RegisterOnDisplayedAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), ATMO_ABILITY(InfoDisplay, onDisplayed));\n    ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 1, ATMO_ABILITY(InfoDisplay, topRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 2, ATMO_ABILITY(InfoDisplay, bottomRightButtonPressed));\n\tATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 3, ATMO_ABILITY(InfoDisplay, topLeftButtonPressed));\n    ATMO_UI_SINGLEICONTEXT_RegisterButtonAbilityHandle(ATMO_VARIABLE(InfoDisplay,pageHandle), 4, ATMO_ABILITY(InfoDisplay, bottomLeftButtonPressed));\n    ATMO_UI_SINGLEICONTEXT_RegisterOnLeaveAbilityHandle(config.templateInstance, ATMO_ABILITY(InfoDisplay, onLeave));\n\treturn ATMO_Status_Success;\n    ",
              "onLeave": "\n\treturn ATMO_Status_Success;\n\t",
              "setLabel": "\n    char label[32];\n    if(ATMO_GetString(in, label, 32) == ATMO_Status_Success)\n    {\n        ATMO_UI_SINGLEICONTEXT_SetMainText(ATMO_VARIABLE(InfoDisplay,pageHandle), label);\n    }\n    else\n    {\n        return ATMO_Status_Fail;\n    }\n\n    return ATMO_Status_Success;\n    "
            },
            "variables": {
              "pageHandle": {
                "type": "ATMO_DriverInstanceHandle_t"
              }
            },
            "embeddedPropertyConversions": {
              "pageTitle": "string",
              "topRightButtonLabel": "string",
...

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

Credits

Timothy Thomas

Timothy Thomas

2 projects • 6 followers
Founder@Electronics Ville Foundation, Electronics Hobbyist, Hardware Hacker, Aviator

Comments