How to Use Atmosphere IoT Application Logic Elements
2019-11-06 | By Maker.io Staff
As you may know, the Atmosphere IoT provides a graphical method for creating applications, where elements are connected with arrows, which perform actions when an event has occurred. Additionally, Atmosphere IoT combines IoT devices with mobile apps and also provides an app maker, which uses elements that can be connected together. This leads to the question: what elements are available in the application builder and what can they do?
BOM
- Adafruit Huzzah 32
- Breadboard
- Smartphone
Application Logic
Application logic elements are used to create the app’s core. These elements include timers, averaging, web communications, and conditions.
NFC
The NFC element is used for “Near Field Communication” a common short-range radio technology. Contactless debit cards, which are used to speed up a payment process, generally for small transactions, are just one example of widespread NFC technology. The NFC element can perform many tasks, including reading metadata and emptying records.
Buffer
The buffer element is used to hold values in a stack, which can be retrieved later. The buffer element can have its index changed so that any element can be selected, have values pushed to it, have values pop from it, be spliced, and cleared. In cases where an internet connection may not be available, the buffer element is very useful.
Average
The average element is used for averaging samples, such as data from a sensor. This element is similar to the buffer in that values can be pushed to it. However, the average element can have a set sample size, meaning that new data being added to the average element will remove old data, which ensures you have an up-to-date averaged value.
Condition
The condition element simply compares the input to a condition, and if that condition is met, the elements connected to the condition are triggered.
Expression
The expression element, which is rather advanced, allows for custom JavaScript code. The custom JavaScript is evaluated to produce a value and is useful in scenarios where there may be a complex mathematical operation or some evaluation of data. Values can be set in the expression, and the expression can be calculated to produce an output.
For Each
The “ForEach” element is a classic function that is often used in typical programming. The element is a loop function that typically takes all of the values in a buffer element and then iterates through each value. From there, each value can be passed into other elements for processing. An example of this would be sending each value to the cloud when an internet connection has been established to publish new sensor readings.
Interval
The interval element fires repeatedly after a predetermined time interval and is useful for frequently checking on data. For example, it is needed when reading up-to-date information from a Bluetooth element.
Web Link
The “WebLink” element is used to open the user’s browser and navigate to a specified web page. This can be useful for “about” buttons and other buttons that open website pages.
Web IO
The “WebIO” element is a fairly powerful element that gives your application the capability to interact with websites via GET and POST HTTP commands. A webpage can be obtained using this element, or data can be submitted to a PHP page, which can be further processed.
Cloud
Cloud elements are used to interact with the cloud service provided by DigiKey IoT. This is important if you want to have dashboards capable of showing data on graphs, charts, and other GUI elements.
Cloud Event
The “CloudEvent1” element is used to send events, which can have values attached to them, to the cloud. For example, a cloud event can be triggered on an interval whereby sensor data in a buffer can be sent for display on a chart.
Cloud Command
The “CloudCommand” element makes it possible for commands to be sent by the cloud to an application. It can be used to trigger other actions, get variable data, change the state of GUI elements on the application, and much more!
Application Interface
The application interface elements are arguably the most important ones. They make up the visual aspect of your app, including buttons, sliders, analog displays, and progress bars!
Button
The button element is used to interact with a button and can obtain the value of a button or perform an action once it is pressed.
Checkbox
The checkbox element is used for interacting with a checkbox on the app. These can be useful in situations where a toggle switch does not make practical sense and when a single press needs to remember an option. For example, an enabled option would be better done with a checkbox, as checking the box implies “yes,” whereas a toggle switch can be more obscure.
Toggle
The toggle switch is similar to a button, but unlike the button, the toggle switch remembers its state, meaning that it can be toggled between on and off. The “Toggle1” element can trigger other elements when its option is changed, and the value of the toggle can be passed on. Turning on and off GPIO is just one common use of a toggle switch.
Image
The image element is used to display an image and is useful for displaying branding, company logos, and general beautification of the application. The image can be changed through other elements, allowing for a possible dynamic GUI indicator. For example, a temperature sensor reading could be used to change the image from a cool indicator to a hot indicator.
Label
The label, which is used to display text, is a very helpful element. The text itself, as well as visibility, color, and size, can be changed by other elements.
Progress Bar
The “ProgressBar” element shows a progress bar whose value can be changed, boundaries adjusted, and visibility changed by other connected elements. This element is useful in situations when some form of progression needs to be visualized. For example, data in a buffer that gets sent to a cloud can use the progress bar to show how much of the data has been submitted.
Analog Meter
The analog meter is a graphical dial that can be used to display analog values. This is a very handy element when reading from sensors that produce analog values, such as temperature, pressure, humidity, and direction. Its value can be changed, its bounds can be adjusted, and visibility can be adjusted.
Slider
The slider is an input element that allows the user to adjust a value by sliding a notch. This element is useful in situations where the user needs to adjust an analog value such as volume, brightness, and color.
Understanding these elements will be key as we move into more advanced and involved projects in the future!
For more IoT solutions information see Internet of Things (IoT) Resource Center
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum