Hardware components | ||||||
| × | 1 | ||||
| × | 2 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
| ||||||
Hand tools and fabrication machines | ||||||
| ||||||
|
System of early detection of gases accumulation in homes, with activation of extractors through cloud connectivity based on Rapid IoT Prototyping Kit.
Always use technology to improve the world, if you are a black hat or gray hat hacker please abstain at this point......... or at least leave your respects to make me feel less guilty XP.
Table of contents
- Introduction
- The Circuits
- Development
- The Final Product
- Comments
- References
In our connected world it seems carelessness prevails, such as leaving open the gas outlet of the stove or not cleaning a chimney and filling the house with CO2; Although these problems are not mortal by themselves, they can become deadly if they are not tended immediately.
For this, we are going to build: A system of real-time monitoring of air quality in homes to alert about harmful levels of hazardous gases in the environment, such as CO2, butane gas, etc. This integral solution consists of an intelligent ventilation system that can extract dangerous gases before they can affect users. And in turn use these devices to generate machine learning models. All this, for the early prevention of these incidents and to determine their frequency.
Today there are basic sensors that provide smoke alerts, warn the detection of smoke at home. Some of them even having complex systems of aspersion to extinguish fires, nevertheless through these systems we cannot collect data, which is one of the main purposes of IoT technology. Besides that, they are not easy to integrate into smart home systems.
This solution might be extremely useful because thanks to this system users can be notified of direct threats caused by minor oversights such as those mentioned above.
The Circuit:The first circuit is the activation of the ESP32 through the light alert of the kit.
The second circuit triggers the fan with another ESP32.
The third circuit is optional, all the instructions to replicate it are in the following link: MOSMusic.
For the development of this project we used a NXP Rapid IoT Prototyping Kit, which is a development kit with a large number of sensors and an impeccable hardware design.
As a first part of the development, a program was developed in https://rapid-iot-studio.nxp.com/ which is the IDE of NXP for this specific kit, as a base for this the IDE has several examples and documentation to perform the programming of the kit. This module is programmed by blocks and the interactions between them. We have simple blocks of comparison to make conditionals and complex blocks for connectivity with NXP or AWS cloud.
As a template we used the example "Rapid IoT Kit Out Of Box Demo" and over it the following blocks were added to develop the luminous air quality alert. You can find it at the bottom under "Air Monitor.atmo".
The comparison blocks have the following configuration.
In this way we can control the NXP light alert so that it is detected by the LED connected to the ESP32.
NOTE: there are light detection sensors for the ESP32, but we take advantage of the fact that an LED is capable of functioning as a transducer, because if a voltage is passed through a LED this generates light, but if it receives light, it can also generate a small voltage between its terminals, in this case 800mV. This being enough to be detected by the ESP32 as an analog input as shown in the image below, also you can see how the ESP32 is already inside a box and the LED on the outside.
The code of the ESP32 will be at the bottom, under "ESP32 Send".
For the second ESP32 the code is called "ESP32 Recv", the ESP32 will turn on one of its digital pins when receiving a "turn on" message through MQTT, to provide that MQTT communication, we have several options.
- https://mosquitto.org/ (Works on EDGE).
- https://www.cloudmqtt.com/ (It is the simplest cloud to perform MQTT through the internet).
- https://www.ibm.com/internet-of-things (It is more complex to configure out but it gives better results, in addition we have an excellent manual to carry out projects on this platform).
Link of the manual of Watson IoT Platform: Watson Guide.
The Final Product:The final project was installed in a room as shown in the video and several experiments were made on what kind of gases or hazards the NXP can detect effectively, it is a great advantage to have an integrated system like this one. This system could save the life of a person or family in a dangerous situation.
Comments:This product that was designed with the NXP Rapid IoT Prototyping Kit shows several competitive advantages over the products currently on the market.
- It's economic
- Does not require large infrastructure investment
- Provides an integral solution and is easily adaptable to the user's needs.
- The relay module is capable of activating any type of high voltage system, extractor or other device.
Therefore, the system could be complemented with a water sprinkler system if it detected a fire.
It is easily adaptable to any SmartHome system.
References:Info for the Arduino boards: https://www.arduino.cc/en/Main/Boards
Sound Sensor Arduino: http://henrysbench.capnfatz.com/henrys-bench/arduino-sensors-and-input/arduino-sound-detection-sensor-tutorial-and-user-manual/
MOSFET: https://www.electronics-tutorials.ws/transistor/tran_6.html
Triac and Diac: https://www.elprocus.com/diac-and-triac-working-and-characteristics/
Infineon: https://www.infineon.com/
Arduino Create WEB Platform: https://create.arduino.cc/
ESP32: https://www.espressif.com/en/products/hardware/esp32/overview
#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();
}
#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;
}
}
{
"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.
Comments