Hardware components | ||||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
When You are stuck in a office for 8 hours a day there are a lot of things that can go wrong with your body. Most of the time people simply forget to take a break and force their bodies to work in a inadequate environment. I have developed a smart bracelet that gives you some perks about your working conditions and helps to shape better habits.
HardwareRSL10 is a very-low-power Bluetooth5 Radio SoC from ON Semiconductors. It currently offers the industry’s lowest power consumption and enables advanced wireless features while optimizing system size and battery life. The RSL10-SENSE-DB-GEVK offers a RSL10 chip combined with battery holder, power management, sensors, 3 push buttons, RGB led, and other really useful features. It was easy to imagine a lot of use cases for such a small and integrated solution.
My project relies just over the base board. I have created a wrist support to be printed in 3D, but it is optional and any method of fixing to the body can be used.
Software and usageSoftware was developed using Atmosphere IoT, which is a fast and easy way to create proof of concepts or even commercial solutions. The embedded components of the project (the firmware of RSL10) captures environmental parameters (temperature, luminosity, accelleration), counts the number of significative movements of the body (more than 0.25g) and checks buttons events (count start, count stop) as interrupts. This data is then sent to the mobile app and displayed in a user-friendly manner.
SetupDownload and install J-LINK software and documentation pack from SEGGER website.
Download and install Atmosphere IoT Agent on the same computer, then add to environment PATH the JLink directory. Follow the tutorial available at the download page of Atmosphere.
Connect the J-LINK Lite debugger/programmer to the programming connector of RSL10-SENSE-GEVK and plug the USB connector to the PC. Don't forget to insert the battery.
Open Atmosphere IoT Platform from any web browser. Login or register, then click over "Import Project" and select the code available below. Project should be already compiled, anyway press "Compile" button at the top of the page and wait about thirty seconds. When compilation finishes navigate to embedded project view and click the programming icon. Once process has finished, unplug USB and programming cables. Eventually insert the board inside the 3D-printed housing.
Take an Android smartphone and install Atmosphere IoT App. Login with the same account used for the platform. Launch the app just installed and navigate to "Devices". Click over "Add device" and select your RSL10. The app should now connect and start to display data. If not, reset button is your friend.
{
"name": "Move!",
"createVersion": "2017-08-12",
"description": "New Project",
"lastModified": "2020-01-30T18:52:31.582Z",
"created": "2020-01-30T18:52:31.582Z",
"meta": {
"projectTypeName": "RSL10-SENSE-GEVK",
"projectTypeId": "RSL10-SENSE-GEVK"
},
"planes": {
"RSL10-SENSE-GEVK": {
"type": "OnSemi",
"compilerVersion": "latest",
"variants": [
"RSL10",
"RSL10-SENSE-GEVK"
],
"meta": {},
"elements": [
{
"name": "BLETemp",
"type": "EmbeddedBLECharacteristicCustom",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables",
"ble"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_BLE_GATTSAddService(\n\t\tATMO_PROPERTY(BLETemp, instance),\n\t\t&ATMO_VARIABLE(BLETemp, bleServiceHandle), \n\t\tATMO_PROPERTY(BLETemp, bleServiceUuid));\n\t\n\tuint8_t property = 0;\n\tuint8_t permission = 0;\n\t\n\tproperty |= ATMO_PROPERTY(BLETemp, read) ? ATMO_BLE_Property_Read : 0;\n\tproperty |= ATMO_PROPERTY(BLETemp, write) ? ATMO_BLE_Property_Write : 0;\n\tproperty |= ATMO_PROPERTY(BLETemp, notify) ? ATMO_BLE_Property_Notify : 0;\n\n\tpermission |= ATMO_PROPERTY(BLETemp, read) ? ATMO_BLE_Permission_Read : 0;\n\tpermission |= ATMO_PROPERTY(BLETemp, write) ? ATMO_BLE_Permission_Write : 0;\n\n\tATMO_DATATYPE types[3] = {ATMO_PROPERTY(BLETemp, writeDataType), ATMO_PROPERTY(BLETemp, readDataType), ATMO_PROPERTY(BLETemp, notifyDataType)};\n\t\n\tATMO_BLE_GATTSAddCharacteristic(\n\t\tATMO_PROPERTY(BLETemp, instance),\n\t\t&ATMO_VARIABLE(BLETemp, bleCharacteristicHandle), \n\t\tATMO_VARIABLE(BLETemp, bleServiceHandle), \n\t\tATMO_PROPERTY(BLETemp, bleCharacteristicUuid), \n\t\tproperty, permission, ATMO_GetMaxValueSize(3, 64, types));\n\t\n\tATMO_BLE_GATTSRegisterCharacteristicAbilityHandle(\n\t\tATMO_PROPERTY(BLETemp, instance),\n\t\tATMO_VARIABLE(BLETemp, bleCharacteristicHandle), \n\t\tATMO_BLE_Characteristic_Written, \n\t\tATMO_ABILITY(BLETemp, written));\n\t\n\treturn ATMO_Status_Success;\n\t",
"setValue": "\n\t\n\t// Convert to the desired write data type\n\tATMO_Value_t convertedValue;\n\tATMO_InitValue(&convertedValue);\n\tATMO_CreateValueConverted(&convertedValue, ATMO_PROPERTY(BLETemp, readDataType), in);\n\n\tATMO_BLE_GATTSSetCharacteristic(\n\t\tATMO_PROPERTY(BLETemp, instance),\n\t\tATMO_VARIABLE(BLETemp, bleCharacteristicHandle),\n\t\tconvertedValue.size, \n\t\t(uint8_t *)convertedValue.data,\n\t\tNULL);\n\t\n\tATMO_FreeValue(&convertedValue);\n\t\t\n\treturn ATMO_Status_Success;\n\t",
"written": "\n\tATMO_CreateValueConverted(out, ATMO_PROPERTY(BLETemp, writeDataType), in);\n\treturn ATMO_Status_Success;\n\t",
"subscibed": "\treturn ATMO_Status_Success;",
"unsubscribed": "\treturn ATMO_Status_Success;"
},
"variables": {
"bleServiceHandle": {
"type": "ATMO_BLE_Handle_t"
},
"bleCharacteristicHandle": {
"type": "ATMO_BLE_Handle_t"
}
},
"embeddedPropertyConversions": {
"bleServiceUuid": "string",
"bleCharacteristicUuid": "string"
},
"codeUserChanged": {
"setup": false,
"setValue": false,
"written": false,
"subscibed": false,
"unsubscribed": false
},
"instance": "ATMO_DRIVERINSTANCE_BLE_BLE1",
"bleServiceUuid": "aea4c91c-4fa8-4847-88b7-1281684d6e5f",
"bleCharacteristicUuid": "aea4c91c-4fa8-4847-88b7-1281684d6e60",
"read": true,
"write": true,
"notify": false,
"readDataType": "ATMO_DATATYPE_INT",
"writeDataType": "ATMO_DATATYPE_INT",
"notifyDataType": "ATMO_DATATYPE_INT"
},
"meta": {
"editorX": 436,
"editorY": 217,
"lastTrigger": "written"
},
"triggers": {
"triggered": [],
"written": [],
"subscibed": [],
"unsubscribed": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"setValue": "valueSet",
"written": false,
"subscibed": false,
"unsubscribed": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "setValue",
"triggers": []
},
{
"name": "written",
"triggers": [
"written"
]
},
{
"name": "subscibed",
"triggers": [
"subscibed"
]
},
{
"name": "unsubscribed",
"triggers": [
"unsubscribed"
]
}
]
},
{
"name": "Fast",
"type": "EmbeddedInterval",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_INTERVAL_Handle_t intervalHandle;\n ATMO_INTERVAL_AddAbilityInterval(\n\t\tATMO_PROPERTY(Fast, instance), \n\t\tATMO_ABILITY(Fast, interval), \n\t\tATMO_PROPERTY(Fast, time), \n\t\t&intervalHandle\n\t);\n\t\n\treturn ATMO_Status_Success;\n\t",
"interval": "\treturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"interval": false
},
"instance": "ATMO_DRIVERINSTANCE_INTERVAL_INTERVAL1",
"time": "250"
},
"meta": {
"editorX": 25,
"editorY": 10,
"lastTrigger": "interval"
},
"triggers": {
"triggered": [],
"interval": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "EmbeddedBHI160",
"targetAbility": "xAcceleration"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"interval": true
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "interval",
"triggers": [
"interval"
]
}
]
},
{
"name": "EmbeddedBHI160",
"type": "EmbeddedBHI160",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": " BHI160_Config_t config;\n config.i2cInstance = ATMO_PROPERTY(EmbeddedBHI160, i2cInstance);\n config.gpioInstance = ATMO_PROPERTY(EmbeddedBHI160, gpioInstance);\n config.intPin = ATMO_PROPERTY(EmbeddedBHI160, intPin);\n\n if(!BHI160_Init(&config))\n {\n return ATMO_Status_Fail;\n }\n return ATMO_Status_Success;",
"xAcceleration": " ATMO_3dFloatVector_t data;\n BHI160_GetData(&data, NULL, NULL);\n ATMO_CreateValueFloat(out, data.x);\n return ATMO_Status_Success;",
"yAcceleration": " ATMO_3dFloatVector_t data;\n BHI160_GetData(&data, NULL, NULL);\n ATMO_CreateValueFloat(out, data.y);\n return ATMO_Status_Success;",
"zAcceleration": " ATMO_3dFloatVector_t data;\n BHI160_GetData(&data, NULL, NULL);\n ATMO_CreateValueFloat(out, data.z);\n return ATMO_Status_Success;",
"acceleration": " ATMO_3dFloatVector_t data;\n BHI160_GetData(&data, NULL, NULL);\n ATMO_CreateValue3dVectorFloat(out, &data);\n return ATMO_Status_Success;",
"angularRate": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, &data, NULL);\n ATMO_CreateValue3dVectorFloat(out, &data);\n return ATMO_Status_Success;",
"xAngularRate": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, &data, NULL);\n ATMO_CreateValueFloat(out, data.x);\n return ATMO_Status_Success;",
"yAngularRate": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, &data, NULL);\n ATMO_CreateValueFloat(out, data.y);\n return ATMO_Status_Success;",
"zAngularRate": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, &data, NULL);\n ATMO_CreateValueFloat(out, data.z);\n return ATMO_Status_Success;",
"orientation": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, NULL, &data);\n ATMO_CreateValue3dVectorFloat(out, &data);\n return ATMO_Status_Success;",
"xOrientation": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, NULL, &data);\n ATMO_CreateValueFloat(out, data.x);\n return ATMO_Status_Success;",
"yOrientation": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, NULL, &data);\n ATMO_CreateValueFloat(out, data.y);\n return ATMO_Status_Success;",
"zOrientation": " ATMO_3dFloatVector_t data;\n BHI160_GetData(NULL, NULL, &data);\n ATMO_CreateValueFloat(out, data.z);\n return ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"xAcceleration": false,
"yAcceleration": false,
"zAcceleration": false,
"acceleration": false,
"angularRate": false,
"xAngularRate": false,
"yAngularRate": false,
"zAngularRate": false,
"orientation": false,
"xOrientation": false,
"yOrientation": false,
"zOrientation": false
},
"i2cInstance": "ATMO_DRIVERINSTANCE_I2C_I2C1",
"gpioInstance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"intPin": 9
},
"meta": {
"editorX": 153,
"editorY": 12,
"lastTrigger": "xAccelerationRead"
},
"triggers": {
"triggered": [],
"xAccelerationRead": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "Function",
"targetAbility": "trigger"
}
],
"yAccelerationRead": [],
"zAccelerationRead": [],
"accelerationRead": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "Function",
"targetAbility": "trigger"
}
],
"angularRateRead": [],
"xAngularRateRead": [],
"yAngularRateRead": [],
"zAngularRateRead": [],
"orientationRead": [],
"xOrientationRead": [],
"yOrientationRead": [],
"zOrientationRead": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"xAcceleration": false,
"yAcceleration": false,
"zAcceleration": false,
"acceleration": false,
"angularRate": false,
"xAngularRate": false,
"yAngularRate": false,
"zAngularRate": false,
"orientation": false,
"xOrientation": false,
"yOrientation": false,
"zOrientation": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "xAcceleration",
"triggers": [
"xAccelerationRead"
]
},
{
"name": "yAcceleration",
"triggers": [
"yAccelerationRead"
]
},
{
"name": "zAcceleration",
"triggers": [
"zAccelerationRead"
]
},
{
"name": "acceleration",
"triggers": [
"accelerationRead"
]
},
{
"name": "angularRate",
"triggers": [
"angularRateRead"
]
},
{
"name": "xAngularRate",
"triggers": [
"xAngularRateRead"
]
},
{
"name": "yAngularRate",
"triggers": [
"yAngularRateRead"
]
},
{
"name": "zAngularRate",
"triggers": [
"zAngularRateRead"
]
},
{
"name": "orientation",
"triggers": [
"orientationRead"
]
},
{
"name": "xOrientation",
"triggers": [
"xOrientationRead"
]
},
{
"name": "yOrientation",
"triggers": [
"yOrientationRead"
]
},
{
"name": "zOrientation",
"triggers": [
"zOrientationRead"
]
}
]
},
{
"name": "BLUE",
"type": "EmbeddedGPIOPin",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_GPIO_Config_t config;\n\tconfig.pinMode = ATMO_PROPERTY(BLUE, mode);\n\tconfig.initialState = ATMO_PROPERTY(BLUE, state);\n\tATMO_GPIO_SetPinConfiguration(ATMO_PROPERTY(BLUE, instance), ATMO_PROPERTY(BLUE, pin), &config);\n\n\t#if ATMO_PROPERTY(BLUE, interruptEnabled) == true\n\t\tATMO_GPIO_RegisterInterruptCallback(\n\t\t\tATMO_PROPERTY(BLUE, instance), \n\t\t\tATMO_PROPERTY(BLUE, pin), \n\t\t\tATMO_PROPERTY(BLUE, interruptMode), \n\t\t\tATMO_INTERRUPT(BLUE, interrupt));\n\t#endif\n\t\n\treturn ATMO_Status_Success;\n\t",
"setState": "\n\tATMO_BOOL_t state;\n\tATMO_GetBool(in, &state);\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(BLUE, instance), ATMO_PROPERTY(BLUE, pin), (ATMO_GPIO_PinState_t)state);\n\treturn ATMO_Status_Success;\n\t",
"setPinHigh": "\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(BLUE, instance), ATMO_PROPERTY(BLUE, pin), ATMO_GPIO_PinState_High);\n\treturn ATMO_Status_Success;\n\t",
"setPinLow": "\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(BLUE, instance), ATMO_PROPERTY(BLUE, pin), ATMO_GPIO_PinState_Low);\n\treturn ATMO_Status_Success;\n\t",
"read": "\n\tATMO_CreateValueBool(out, ATMO_GPIO_Read(ATMO_PROPERTY(BLUE, instance), ATMO_PROPERTY(BLUE, pin)));\n\treturn ATMO_Status_Success;\n\t",
"toggle": "\n\tATMO_GPIO_Toggle(ATMO_PROPERTY(BLUE, instance), ATMO_PROPERTY(BLUE, pin));\n\treturn ATMO_Status_Success;\n\t",
"interrupt": "\n\tATMO_CreateValueCopy(out, in);\n\treturn ATMO_Status_Success;\n\t"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"setState": false,
"setPinHigh": false,
"setPinLow": false,
"read": false,
"toggle": false,
"interrupt": false
},
"instance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"pin": "RSL10_LED_BLUE",
"mode": "ATMO_GPIO_PinMode_Output_PushPull",
"state": "ATMO_GPIO_PinState_Low",
"interruptEnabled": false,
"interruptMode": "ATMO_GPIO_InterruptTrigger_None"
},
"meta": {
"editorX": 431,
"editorY": 14,
"lastTrigger": "interrupt"
},
"triggers": {
"triggered": [],
"stateSet": [],
"read": [],
"toggled": [],
"interrupt": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"setState": false,
"setPinHigh": false,
"setPinLow": false,
"read": false,
"toggle": false,
"interrupt": true
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "setState",
"triggers": [
"stateSet"
]
},
{
"name": "setPinHigh",
"triggers": [
"stateSet"
]
},
{
"name": "setPinLow",
"triggers": [
"stateSet"
]
},
{
"name": "read",
"triggers": [
"read"
]
},
{
"name": "toggle",
"triggers": [
"toggled"
]
},
{
"name": "interrupt",
"triggers": [
"interrupt"
]
}
]
},
{
"name": "Function",
"type": "EmbeddedFunction",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": " float movement;\n\tATMO_GetFloat(in, &movement);\n\tif((movement > (float)0.25) && (recording)){\n\t ATMO_CreateValueBool(out, true);\n\t movements++;\n\t}else{\n\t ATMO_CreateValueBool(out, false);\n\t}\n\treturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"trigger": true
}
},
"meta": {
"editorX": 295,
"editorY": 11,
"lastTrigger": "triggered"
},
"triggers": {
"triggered": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "BLUE",
"targetAbility": "setState"
}
]
},
"interruptAbilities": {
"trigger": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
}
]
},
{
"name": "BTN1",
"type": "EmbeddedGPIOPin",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_GPIO_Config_t config;\n\tconfig.pinMode = ATMO_PROPERTY(BTN1, mode);\n\tconfig.initialState = ATMO_PROPERTY(BTN1, state);\n\tATMO_GPIO_SetPinConfiguration(ATMO_PROPERTY(BTN1, instance), ATMO_PROPERTY(BTN1, pin), &config);\n\n\t#if ATMO_PROPERTY(BTN1, interruptEnabled) == true\n\t\tATMO_GPIO_RegisterInterruptCallback(\n\t\t\tATMO_PROPERTY(BTN1, instance), \n\t\t\tATMO_PROPERTY(BTN1, pin), \n\t\t\tATMO_PROPERTY(BTN1, interruptMode), \n\t\t\tATMO_INTERRUPT(BTN1, interrupt));\n\t#endif\n\t\n\treturn ATMO_Status_Success;\n\t",
"setState": "\n\tATMO_BOOL_t state;\n\tATMO_GetBool(in, &state);\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(BTN1, instance), ATMO_PROPERTY(BTN1, pin), (ATMO_GPIO_PinState_t)state);\n\treturn ATMO_Status_Success;\n\t",
"setPinHigh": "\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(BTN1, instance), ATMO_PROPERTY(BTN1, pin), ATMO_GPIO_PinState_High);\n\treturn ATMO_Status_Success;\n\t",
"setPinLow": "\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(BTN1, instance), ATMO_PROPERTY(BTN1, pin), ATMO_GPIO_PinState_Low);\n\treturn ATMO_Status_Success;\n\t",
"read": "\n\tATMO_CreateValueBool(out, ATMO_GPIO_Read(ATMO_PROPERTY(BTN1, instance), ATMO_PROPERTY(BTN1, pin)));\n\treturn ATMO_Status_Success;\n\t",
"toggle": "\n\tATMO_GPIO_Toggle(ATMO_PROPERTY(BTN1, instance), ATMO_PROPERTY(BTN1, pin));\n\treturn ATMO_Status_Success;\n\t",
"interrupt": "\n\tATMO_CreateValueCopy(out, in);\n\treturn ATMO_Status_Success;\n\t"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"setState": false,
"setPinHigh": false,
"setPinLow": false,
"read": false,
"toggle": false,
"interrupt": false
},
"instance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"pin": "RSL10_PB1",
"mode": "ATMO_GPIO_PinMode_Input_PullDown",
"state": "ATMO_GPIO_PinState_Low",
"interruptEnabled": true,
"interruptMode": "ATMO_GPIO_InterruptTrigger_RisingEdge"
},
"meta": {
"editorX": 29,
"editorY": 456,
"lastTrigger": "interrupt"
},
"triggers": {
"triggered": [],
"stateSet": [],
"read": [],
"toggled": [],
"interrupt": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "startMovNmb",
"targetAbility": "trigger"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "GREEN",
"targetAbility": "setPinHigh"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"setState": false,
"setPinHigh": false,
"setPinLow": false,
"read": false,
"toggle": false,
"interrupt": true
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "setState",
"triggers": [
"stateSet"
]
},
{
"name": "setPinHigh",
"triggers": [
"stateSet"
]
},
{
"name": "setPinLow",
"triggers": [
"stateSet"
]
},
{
"name": "read",
"triggers": [
"read"
]
},
{
"name": "toggle",
"triggers": [
"toggled"
]
},
{
"name": "interrupt",
"triggers": [
"interrupt"
]
}
]
},
{
"name": "startMovNmb",
"type": "EmbeddedFunction",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\trecording = true;\n\tmovements = 0;\n\treturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"trigger": true
}
},
"meta": {
"editorX": 247,
"editorY": 555,
"lastTrigger": "triggered"
},
"triggers": {
"triggered": []
},
"interruptAbilities": {
"trigger": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
}
]
},
{
"name": "GREEN",
"type": "EmbeddedGPIOPin",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_GPIO_Config_t config;\n\tconfig.pinMode = ATMO_PROPERTY(GREEN, mode);\n\tconfig.initialState = ATMO_PROPERTY(GREEN, state);\n\tATMO_GPIO_SetPinConfiguration(ATMO_PROPERTY(GREEN, instance), ATMO_PROPERTY(GREEN, pin), &config);\n\n\t#if ATMO_PROPERTY(GREEN, interruptEnabled) == true\n\t\tATMO_GPIO_RegisterInterruptCallback(\n\t\t\tATMO_PROPERTY(GREEN, instance), \n\t\t\tATMO_PROPERTY(GREEN, pin), \n\t\t\tATMO_PROPERTY(GREEN, interruptMode), \n\t\t\tATMO_INTERRUPT(GREEN, interrupt));\n\t#endif\n\t\n\treturn ATMO_Status_Success;\n\t",
"setState": "\n\tATMO_BOOL_t state;\n\tATMO_GetBool(in, &state);\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(GREEN, instance), ATMO_PROPERTY(GREEN, pin), (ATMO_GPIO_PinState_t)state);\n\treturn ATMO_Status_Success;\n\t",
"setPinHigh": "\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(GREEN, instance), ATMO_PROPERTY(GREEN, pin), ATMO_GPIO_PinState_High);\n\treturn ATMO_Status_Success;\n\t",
"setPinLow": "\n\tATMO_GPIO_SetPinState(ATMO_PROPERTY(GREEN, instance), ATMO_PROPERTY(GREEN, pin), ATMO_GPIO_PinState_Low);\n\treturn ATMO_Status_Success;\n\t",
"read": "\n\tATMO_CreateValueBool(out, ATMO_GPIO_Read(ATMO_PROPERTY(GREEN, instance), ATMO_PROPERTY(GREEN, pin)));\n\treturn ATMO_Status_Success;\n\t",
"toggle": "\n\tATMO_GPIO_Toggle(ATMO_PROPERTY(GREEN, instance), ATMO_PROPERTY(GREEN, pin));\n\treturn ATMO_Status_Success;\n\t",
"interrupt": "\n\tATMO_CreateValueCopy(out, in);\n\treturn ATMO_Status_Success;\n\t"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"setState": false,
"setPinHigh": false,
"setPinLow": false,
"read": false,
"toggle": false,
"interrupt": false
},
"instance": "ATMO_DRIVERINSTANCE_GPIO_GPIO1",
"pin": "RSL10_LED_GREEN",
"mode": "ATMO_GPIO_PinMode_Output_PushPull",
"state": "ATMO_GPIO_PinState_Low",
"interruptEnabled": false,
"interruptMode": "ATMO_GPIO_InterruptTrigger_None"
},
"meta": {
"editorX": 248,
"editorY": 408,
"lastTrigger": "interrupt"
},
"triggers": {
"triggered": [],
"stateSet": [],
"read": [],
"toggled": [],
"interrupt": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"setState": false,
"setPinHigh": false,
"setPinLow": false,
"read": false,
"toggle": false,
"interrupt": true
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "setState",
"triggers": [
"stateSet"
]
},
{
"name": "setPinHigh",
"triggers": [
"stateSet"
]
},
{
"name": "setPinLow",
"triggers": [
"stateSet"
]
},
{
"name": "read",
"triggers": [
"read"
]
},
{
"name": "toggle",
"triggers": [
"toggled"
]
},
{
"name": "interrupt",
"triggers": [
"interrupt"
]
}
]
},
{
"name": "BME680",
"type": "EmbeddedBME680",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "BME680_Config_t config;\nconfig.i2cInstance = ATMO_PROPERTY(BME680, i2cInstance );\nconfig.i2cAddr = ATMO_PROPERTY(BME680, i2cAddress );\n\nif ( !BME680_Init( &config ) )\n{\n\treturn ATMO_Status_Fail;\n}\n\nreturn ATMO_Status_Success;",
"readTemperature": "float temperature = 0.0;\n\nif ( BME680_GetTempData( &temperature ) != BME680_Status_Success )\n{\n\treturn ATMO_Status_Fail;\n}\n\nATMO_CreateValueFloat( out, temperature );\n\nreturn ATMO_Status_Success;",
"readHumidity": "float humidity = 0.0;\n\nif ( BME680_GetHumidity( &humidity ) != BME680_Status_Success )\n{\n\treturn ATMO_Status_Fail;\n}\n\nATMO_CreateValueFloat( out, humidity );\n\nreturn ATMO_Status_Success;",
"readPressure": "float pressure = 0.0;\n\nif ( BME680_GetPressure( &pressure ) != BME680_Status_Success )\n{\n\treturn ATMO_Status_Fail;\n}\n\nATMO_CreateValueFloat( out, pressure );\n\nreturn ATMO_Status_Success;",
"readGasResistance": "float gas_resistance = 0.0;\n\nif ( BME680_GetGasRes( &gas_resistance ) != BME680_Status_Success )\n{\n\treturn ATMO_Status_Fail;\n}\n\nATMO_CreateValueFloat( out, gas_resistance );\n\nreturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"readTemperature": false,
"readHumidity": false,
"readPressure": false,
"readGasResistance": false
},
"i2cInstance": "ATMO_DRIVERINSTANCE_I2C_I2C1",
"i2cAddress": "0x76"
},
"meta": {
"editorX": 177,
"editorY": 219,
"lastTrigger": "temperatureRead"
},
"triggers": {
"triggered": [],
"temperatureRead": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "DataTypeConvert",
"targetAbility": "convert"
}
],
"humidityRead": [],
"pressureRead": [],
"gasResistanceRead": []
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"readTemperature": false,
"readHumidity": false,
"readPressure": false,
"readGasResistance": false
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "readTemperature",
"triggers": [
"temperatureRead"
]
},
{
"name": "readHumidity",
"triggers": [
"humidityRead"
]
},
{
"name": "readPressure",
"triggers": [
"pressureRead"
]
},
{
"name": "readGasResistance",
"triggers": [
"gasResistanceRead"
]
}
]
},
{
"name": "Slow",
"type": "EmbeddedInterval",
"variants": [
"embedded",
"triggers",
"abilities",
"properties",
"variables"
],
"properties": {
"errorData": {},
"code": {
"trigger": "\treturn ATMO_Status_Success;",
"setup": "\n\tATMO_INTERVAL_Handle_t intervalHandle;\n ATMO_INTERVAL_AddAbilityInterval(\n\t\tATMO_PROPERTY(Slow, instance), \n\t\tATMO_ABILITY(Slow, interval), \n\t\tATMO_PROPERTY(Slow, time), \n\t\t&intervalHandle\n\t);\n\t\n\treturn ATMO_Status_Success;\n\t",
"interval": "\treturn ATMO_Status_Success;"
},
"variables": {},
"embeddedPropertyConversions": {},
"codeUserChanged": {
"setup": false,
"interval": false
},
"instance": "ATMO_DRIVERINSTANCE_INTERVAL_INTERVAL1",
"time": "5000"
},
"meta": {
"editorX": 25,
"editorY": 218,
"lastTrigger": "interval"
},
"triggers": {
"triggered": [],
"interval": [
{
"mapping": {},
"targetOrder": [],
"targetElement": "BME680",
"targetAbility": "readTemperature"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "getMovNmb",
"targetAbility": "trigger"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "GREEN",
"targetAbility": "setPinLow"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "NOA1305AmbientLight",
"targetAbility": "readAmbientLight"
},
{
"mapping": {},
"targetOrder": [],
"targetElement": "RED",
"targetAbility": "setPinLow"
}
]
},
"interruptAbilities": {
"trigger": false,
"setup": false,
"interval": true
},
"abilities": [
{
"name": "trigger",
"triggers": [
"triggered"
]
},
{
"name": "setup",
"triggers": []
},
{
"name": "interval",
"triggers": [
"interval"
]
}
]
},
{
"name": "getMovNmb",
"type": "EmbeddedFunction",
"variants": [
"embedded",
...
This file has been truncated, please download it to see its full contents.
Comments