Skip to content

Commit ead6e21

Browse files
authored
Merge pull request #455 from arduino/karlsoderby/iotc-widget-article
[MKC-600] IoTC Widget/dashboard article
2 parents e292417 + 66680fd commit ead6e21

20 files changed

+304
-597
lines changed

content/arduino-cloud/01.getting-started/02.technical-reference/iot-cloud-tech-ref.md

+2-280
Original file line numberDiff line numberDiff line change
@@ -641,293 +641,15 @@ The full editor allows for more control over the code and its libraries and prov
641641
***Please note: the status of the connection to the Network and Arduino IoT Cloud may be checked by opening the Serial Monitor after uploading a sketch. If the `while(!Serial);` loop is included in the `setup()` function, the code would not execute before opening the Serial Monitor.***
642642

643643

644-
## Dashboards
644+
## Dashboards & Widgets
645645

646646
Dashboards are **visual user interfaces** for interacting with your boards over the cloud, which can be customized with different setups depending on the project's needs.
647647

648648
One or more **Things** can be added to a **Dashboard**, with all or some of their variables. The dashboards can be accessed by navigating to the **“Dashboards”** page at the top menu of the Arduino IoT Cloud interface, where a list of the **existing Dashboards** and an option to **create a new Dashboard** are available.
649649

650650
![Create widgets from a Thing](./images/create-widget-from-thing.png)
651651

652-
### Widgets
653-
654-
On the Dashboard **widgets can be added individually** and linked to variables, and variables can be assigned to widgets **automatically by adding a Thing**.
655-
656-
Additionally, the widgets can be **resized and rearranged** on the dashboard using the **"Arrange widgets"** icon. All widgets available are shown in the images below.
657-
658-
![The Arduino IoT Cloud widgets](./images/cloud-widgets.png)
659-
660-
Widgets are visual representations of variables. You can for example choose to have a **Gauge Widget** for a variable storing temperature readings, or a **Chart Widget** for monitoring energy consumption. Depending on the variable's permission, the Widget looks different:
661-
662-
- Read Only cannot be interacted with (e.g. charts)
663-
- Read & Write can be interacted with (e.g. sliders, steppers)
664-
665-
### Sharing Dashboards
666-
667-
It is possible to share your live dashboards with external people. To do so, please refer to the guide in the link below:
668-
669-
- [Sharing Dashboards in the Arduino IoT Cloud](/cloud/iot-cloud/tutorials/sharing-dashboards)
670-
671-
672-
### Downloading Historical Data
673-
674-
You can download the historical data of one or multiple variables. This can be done directly in the dashboard interface, by clicking the information sign at the top right corner, and clicking on download data.
675-
676-
![Downloading historical data](images/download-historical-data.png)
677-
678-
Here you can do the following:
679-
680-
- Search for specific variables
681-
- Select a period of time
682-
- Select one (or all) variables
683-
684-
Once you have selected the variables you want data from, click on the **"Select Data Source"** button and then on the **"Get Data"** button. An email will be sent to you with a log file.
685-
686-
### List of Widgets
687-
688-
Below you will find a list of available widgets, and examples on how they are linked to a variable used in a sketch.
689-
690-
#### Switch
691-
692-
![The Switch Widget](./images/widget-switch.png)
693-
694-
The switch widget is great for simply turning something ON or OFF.
695-
696-
Can be linked with a **boolean** variable.
697-
698-
An example of how it is used in a sketch:
699-
700-
```arduino
701-
if(switchVariable == true){
702-
digitalWrite(ledPin, HIGH);
703-
}
704-
705-
else{
706-
digitalWrite(ledPin, LOW);
707-
}
708-
```
709-
710-
#### Push Button
711-
712-
![Push Button Widget](images/widget-pushbutton.png)
713-
714-
The push button widget is a virtual version of a push button. While pushed down, something is activated, and when released, it is de-activated.
715-
716-
Can be linked with a **boolean** variable.
717-
718-
An example of how it is used in a sketch:
719-
720-
```arduino
721-
while(pushbuttonVariable == true){
722-
counter++
723-
delay(10);
724-
}
725-
```
726-
727-
#### Slider
728-
729-
![Slider Widget](images/widget-slider.png)
730-
731-
The slider widget can be used to adjust a value range. Great for changing the intensity of light, or the speed of a motor.
732-
733-
Can be linked with multiple variables, including **integers & floats.**
734-
735-
An example of how it is used in a sketch:
736-
737-
```arduino
738-
analogWrite(ledPin, sliderVariable);
739-
```
740-
741-
#### Stepper
742-
743-
![Stepper Widget](images/widget-stepper.png)
744-
745-
Similar to the slider, the stepper widget increases or decreases a variable by increments of 1. It can be used to switch between different modes.
746-
747-
Can be linked with multiple variables, including **integers & floats.**
748-
749-
An example of how it is used in a sketch:
750-
751-
```arduino
752-
if(stepperVariable == 10){
753-
activateThisFunction();
754-
}
755-
756-
//activate another function
757-
else if(stepperVariable == 11){
758-
activateAnotherFunction();
759-
}
760-
761-
//or simply print out the updated value
762-
Serial.println(stepperVariable);
763-
```
764-
765-
#### Messenger
766-
767-
![Messenger Widget](images/widget-messenger.png)
768-
769-
The messenger widget can be used to send and receive strings through the messenger window.
770-
771-
Can be linked with a **String** variable.
772-
773-
An example of how it is used in a sketch:
774-
775-
```arduino
776-
stringVariable = "This is a string";
777-
```
778-
779-
#### Color
780-
781-
![Color Widget](images/widget-color.png)
782-
783-
The color widget is great for selecting an exact color for an RGB light.
784-
785-
Can be linked with a **Color** variable.
786-
787-
An example of how it is used in a sketch:
788-
789-
```arduino
790-
uint8_t r, g, b;
791-
rgbVariable.getValue().getRGB(r, g, b);
792-
```
793-
794-
#### Dimmed Light
795-
796-
![Dimmed Light Widget](images/widget-dimmed-light.png)
797-
798-
The dimmed light widget is great for changing the intensity of a light, and to be able to turn it ON and OFF as well.
799-
800-
Can be linked with a **Dimmed Light** variable.
801-
802-
An example of how it is used in a sketch:
803-
804-
```arduino
805-
//retrieve and map brightness value from cloud
806-
uint8_t brightness = map(dimmedVariable.getBrightness(), 0, 100, 0, 255);
807-
808-
//then check if switch is on/off
809-
if (dimmedVariable.getSwitch()) {
810-
analogWrite(6, brightness); //write brightness value to pin 6
811-
}
812-
else{
813-
analogWrite(6, LOW); //turn off lamp completely
814-
}
815-
```
816-
817-
#### Colored light
818-
819-
![Colored Light Widget](images/widget-color-light.png)
820-
821-
The colored light widget is designed to set the color for a lamp, and can turn it ON and OFF as well.
822-
823-
Can be linked with a **Colored Light** variable.
824-
825-
An example of how it is used in a sketch:
826-
827-
```arduino
828-
uint8_t r, g, b;
829-
rgbVariable.getValue().getRGB(r, g, b);
830-
```
831-
832-
#### Value
833-
834-
![Value Widget](images/widget-value.png)
835-
836-
The value widget is a simple one. It only reads, or writes values without any additional functionalities.
837-
838-
Can be linked with many different variables.
839-
840-
An example of how it is used in a sketch:
841-
842-
```arduino
843-
valueVariable = analogRead(A0);
844-
```
845-
846-
#### Status
847-
848-
![Status Widget](images/widget-status.png)
849-
850-
The status widget is great for checking the state of something: green is positive, red is negative!
851-
852-
Can be linked to a **boolean** variable.
853-
854-
An example of how it is used in a sketch:
855-
856-
```arduino
857-
statusVariable = true;
858-
//or
859-
statusVariable = false;
860-
```
861-
862-
#### Gauge
863-
864-
![Gauge Widget](images/widget-gauge.png)
865-
866-
The gauge widget is the go-to for any measurements that fit in a half circle. A great widget for building organized, professional dashboards.
867-
868-
Can be linked with multiple variables, including **integers & floats.**
869-
870-
An example of how it is used in a sketch:
871-
872-
```arduino
873-
gaugeVariable = analogRead(A0);
874-
```
875-
876-
#### Percentage
877-
878-
![Percentage Widget](images/widget-percentage.png)
879-
880-
Much like the gauge widget, the percentage widget displays percentage in a more visual way.
881-
882-
Can be linked with multiple variables, including **integers & floats.**
883-
884-
An example of how it is used in a sketch:
885-
886-
```arduino
887-
percentageVariable = analogRead(A0);
888-
```
889-
890-
#### LED
891-
892-
![LED Widget](images/widget-led.png)
893-
894-
The LED widget is a virtual LED that can signal the status of something. Can either be set to ON or OFF.
895-
896-
Can be linked with a **boolean** variable.
897-
898-
An example of how it is used in a sketch:
899-
900-
```arduino
901-
ledVariable = true;
902-
//or
903-
ledVariable = false;
904-
```
905-
906-
#### Map
907-
908-
![Map Widget](images/widget-map.png)
909-
910-
The map widget is a tool for keeping track on the location of your projects. This is a great tool for any project involving GPS, or to get an overview of where your Thing, or multiple Things are operating.
911-
912-
Can be linked with the **Location** variable.
913-
914-
An example of how it is used in a sketch:
915-
916-
```arduino
917-
locationVariable = Location(51.5074, 0.1278);
918-
```
919-
920-
#### Chart
921-
922-
![Chart Widget](images/widget-chart.png)
923-
924-
The chart widget is great for data analytics. It is used to track real time data, as well as tracking historical data. This widget can for example be used to track temperature changes, energy consumption and other sensor values. A chart widget can only be linked to one variable at a time.
925-
926-
An example of how it is used in a sketch:
927-
928-
```arduino
929-
locationChart = analogRead(A0);
930-
```
652+
***You can read more about [Dashboards & Widgets]().***
931653

932654
## Recommended Code Practices
933655

0 commit comments

Comments
 (0)