This example shows how MyViz, running on your computer, can communicate with an Arduino Uno through a serial link.
The files can be downloaded for the following systems:
- Windows: SerialPort_1.zip
- Linux: SerialPort_1.zip
- Mac OS X: SerialPort_1.zip
In order to run this example, you need to follow these steps (provided that MyViz is already installed):
- Extract the archive somewhere on your computer
- Connect your Arduino board to your computer
- Upload on this board the sketch “Tutorial_SerialPort_1.ino”, located in the “Arduino” folder of the archive
- In the “Dashboard” folder, open “Tutorial_SerialPort_1.json”
- Make one of the following replacement, depending on your operating system:
- for Windows, replace the three “COM24” strings by the COM port connected to your Arduino board
- for Linux, replace the three “/dev/ttyACM0” strings by the serial port used by your Arduino board
- for Mac OS X, replace the three “/dev/cu.usbmodem9f31” strings by the serial port used by your Arduino board
- Run MyViz. It opens with an empty window:
- Click on “Load Dashboard” and open the file “Tutorial_SerialPort_1.json” you modified previously. You should see the dashboard running:
If you don’t see values “moving”, double check the name of the serial port connected to your Arduino and check the replacement you made in the “Tutorial_SerialPort_1.json” file.
- If it works, you can:
- click on the LED switch to switch on or off the LED of your Arduino
- move the slider, to see the plot of the value sent back by the board
- connect the analog inputs A0 and A1 to any sensor to see their values plotted in real time
- To edit the dashboard, click on the icon on the top-middle of the window. Then you can modify any widget: