This example is inspired by the post "easy GUI front ends for Arduino Raspberry pi, and more with MyOpenLab" by Al Williams (Twitter, LinkedIn) published on hackaday.com. In this example you will build a bench tool by creating a "VirtualMachine (VM)" (i.e., virtual interfaces in MyLibreLab/MyOpenLab lingo). The VM will use your computer as a control panel and readout, and the electronic hardware as the physical interface. The MyLibreLab VM consists of two parts, like LabVIEW programs, a front end panel GUI and a block diagram program. some components of the block diagram will be also on the front panel such as switches, LEDs. While, some components only live on the block diagram side of the VM. On the block diagram panel you can connect components together to implement a computational algorithm or represent signal flow to physical systems such as Arduino and Raspberry Pi I/O.
To follow along this tutorial you need the hardware mentioned in this arduino.cc tutorial and a USB connection to the computer. Alternatively If you don’t have access to the actual hardware you may use software Like SimulIDE and KTechLab to emulate the hardware and have virtual serial ports. (#todo)
Firmata library provides a standard protocol for serial communication and control of an Arduino expansion board. Connect the Arduino Uno board to the computer via USB cable, and open the Arduino IDE. Make sure you have the right port and board selected from the Menu bar > Tools:
Select the standardFirmata sketch from Menu bar > File > Examples > Firmata > StandardFirmata
and add the line below as the first line of the setup function:
analogReference(INTERNAL);
or alternatively upload the standardFirmata/StandardFirmata.ino sketch in this tutorial to the Arduino board.
To test that everything is working properly, open the Menu bar > Tools > Serial Monitor
and make sure the Baud rate of 57600 is selected at the bottom right corner
you should see the above message in the terminal.
Open the MyLibreLab software and create a new project from the toolbar or the menu bar (Alt⌥+a).
by specifying the Project Name, Project Location, and name of the Main VM and select OK:
then from the menu bar select the Interfaces:
and consequently select the Arduino Standard Firmata Interface …
and place it on the Circuit Panel:
while the Firmata block is selected, on the Property-Editor panel, choose the right COM Port:
and then select the … on the Config Pins row.
activate Pin 2 as DIGITAL_INPUT and Pin 13 as DIGITAL_OUTPUT. Go to the Front panel and then select the Boolean:
put an Tilt button and LED red on the Front Panel:
now go back to the Circuit panel and connect the switch to Pin 2 and the Pin 13 to the LED
and then run:
















