Visualise data from your device
Last updated
Last updated
In this section, we will explain to you how to create widgets for data visualisation and set up your device's dashboard on Pybytes.
The first step is to have an application running on your device. The application in this example sends data from a vector every 10 seconds to Pybytes.
Open the main.py
file on Pymakr;
Insert the following code on your main.py
;
3. Upload the code into your device. Now your device is sending data to Pybytes.
In this code, we're calling the function pybytes.send_virtual_pin_value(persistent, pin, value))
to communicate with Pybytes. This function is part of the Pybytes library, and it has three arguments: persistent
, pin
and value
.
persistent
denotes information that is infrequently accessed and not likely to be modified;
pin
represents which virtual pin is receiving data;
value
is the value being attributed to that particular pin.
Go to Pybytes.
On Devices
page select a device;
2. On your device's page click on Data
tab.
3. Click on the Define New Signal
button.
4. Define the new signal by entering a number, a name, a data type and a unit. Finally, click on the button Define
.
5. Your signal was added!
Click on the signal card.
2. Click on the button Create a new display
.
3. Select the type of visualisation (e.g. Bar chart or Line chart).
4. You can adjust the parameters of your widget at Settings
. After, click on the button Create
.
5. Your widget was created. Now, add your widget to your device's dashboard. Click on the button Edit
on your widget.
6. Mark the checkbox Display on Dashboard
at Settings
. Finally, click on the button Save
.
7. Click on the tab Dashboard
. Your widget was successfully added there!
Click on the button Organise
. Now the dashboard's grid will enter the edit mode and allow you to resize and reposition its widgets.
2. Resize a widget by clicking on the triangle icon at the bottom right corner of the widget and drag the cursor over the grid. After, click on the button Save
to save this action.
3. Change the widget's position by drag-and-dropping it over the grid. After, click on the button Save
to save this action.
Now you've learned how to set up your device's dashboard to display data. Also, you can add more widgets to other pins of your device.