Arduino Connection

Video Transcript

The Arduino Communicator lets you connect to an Arduino while working on your project, then upload a final project when you are done.

When you connect to an Arduino, any node in your project that interacts with a physical pin gets compiled and uploaded to your Arduino. Nodes that don’t interact with physical pins are processed on your computer, so you only need to refresh the connection when you add or remove nodes that touch pins. While connected your computer is constantly sending and receiving data to and from the Arduino for display on the screen.

For example we will control the built in LED on an Arduino Uno. In a new project, drag a digital output node onto the first agent. The pin number defaults to 13, which is the pin for the built in LED on most Arduino models. To connect to the Arduino simply select the Arduino model and com port, then click on the connection icon and wait for the program to be uploaded and show “good connection”. Now when you drag the input activation above .5 the LED will turn on.

To illustrate uploading a final program we will create a simple Blink function. From the Flow Control tab, add a Switch and connect the output Activation to the Digital Output’s input Activation. Notice that because the Switch node doesn’t interact with any physical pins on the Arduino it runs entirely in Embrio so we don’t need to refresh the connection. Clicking on the Toggle input now turns the LED on and off.

From the Flow Control toolbar add a Timer node. Connect the Done output to the Restart input to make the timer repeat. Also connect the Done output to the Switch’s Toggle input. Now the LED turns on and off every second.

Finally note that while designing this program we started the timer running, but in a compiled program the timer will not start by default. Drag a Startup Trigger node from the Flow Control toolbar and connect it’s trigger to the Timer’s Turn On trigger.

Now our project is complete. Press the Compile and Upload button to upload a program that runs entirely on the Arduino.

View discussion page on forum