Arduino Support in Vizard

By Jeff Loomis and Sado Rabaudi

Arduino uses its own language which is similar to C++. Instead, Python can be used and the easiest way to do that is having the board and Python communicate with the Firmata protocol. pyfirmata installs directly in the package manager. There's a lot of information on working with Arduino in this article:

https://realpython.com/arduino-python/

Use the following steps to use Arduino with Vizard:

  1. Install Arduino IDE

  1. Upload the Firmata sketch to the arduino board (File- Examples-  Firmata -StandardFirmata). See the section called Uploading the Firmata Sketch

  1. The sketch will be loaded into a new IDE window. To upload it to the Arduino:

  • Plug the USB cable into the PC.

  • Select the appropriate board (Tools- Board. For Arduino Uno, you should select Arduino/Genuino Uno)

  • Select port (under Tools- Port)

  • Press Upload

  1. Next, make sure that pyFirmata is installed from the package manager by going to Vizard and choosing Tools- Package Manager- Search and then searching “pyfirmata”

  1. After that you should be able to run pyfirmata/python code in Vizard to communicate with the device. There's examples in the realpython article for communication over both digital and analog pins.

Vizard Sample Code: