Tutorial
Tutorial
Tutorial
Table of contents
Arduino plugin tutorial.........................................................................................................................1
Quick start............................................................................................................................................1
Upload BreakoutFirmata to your Arduino...........................................................................................1
Run the Breakout Server......................................................................................................................2
Install the plugin...................................................................................................................................2
Use the plugin......................................................................................................................................2
Settings............................................................................................................................................2
On board ready................................................................................................................................2
Enable pins......................................................................................................................................3
Input pins.........................................................................................................................................3
Output pins......................................................................................................................................3
/ Here are my enabled pins..............................................................................................................3
Input pin changed............................................................................................................................4
Control output pins..........................................................................................................................4
Mobile..................................................................................................................................................4
Exporting for HTML5..........................................................................................................................5
Mobile on a local server..................................................................................................................6
Compatible I/O boards.........................................................................................................................6
Tested Arduino Boards....................................................................................................................6
Compatible operation systems.............................................................................................................7
Compatible mobile web browsers........................................................................................................7
If you are stuck.....................................................................................................................................7
Quick start
To start quick please watch this video: https://youtu.be/8RK-fasJs9A
The name of your computer and the network port you are connected to should be printed along with
the serial port your Arduino is connected to (on windows this will say something like “COM3”).
If you have a firewall enabled for your computer or network, make sure port 8887 is open, or
enter a new port number that is open (be sure to hit the enter key upon typing in a new port
number). For more information on the Breakout Server please visit
http://breakoutjs.com/getting-started/
Java Runtime Environment version 1.6 or higher must be installed. It’s pre installed on OS X.
Windows and Linux users may need to install Java. Get it at https://www.java.com/.
On board ready
To initialize the Arduino plugin, add the event "On board ready". This is essential!
Enable pins
Then enable the Arduino I/O pins you whish to use - as actions to the "On board ready" event.
Input pins
For analog input select "EnableAnalogPin". For digital input select "EnableDigitalPin".
Make sure the pin numbers you select are actually analog or digital input pins on your Arduino.
Output pins
For all output (digital output and PWM output/analog output) select "EnableDigitalPin".
Make sure the pin numbers you select are actually digital output or (for PWM/analog output) digital
output with PWM on your Arduino.
Or this:
Control output pins
You can also make game events that trigger outputs to the digital and analog pins:
Or to turn the servo at pin 6 via the compas in a mobile/tablet running your Construct project:
-here the "DeviceRotation" is a global variable that detects changes in the mobile/tablet compas
rotation and then - if the compas is also within 180 degrees (the normal servo limit) - sends a new
direction to the servo at pin 6.
Mobile
If you run your Construct project on a mobile/tablet, your Arduino still needs to be connected to a
computer running the Breakout server. And you will have to change the "Host" property in the
plugin settings to the computer's IP adress (you can look up your IP adress in Construct 2 /
Preferences / Preview / Preview on LAN address / ... /).
For more information on easy previewing and testing on your local network please visit:
https://www.scirra.com/tutorials/247/how-to-preview-on-a-local-network
So, as allways with Construct, your project has to run on a server when exportet as HTML5. You
can host it on a remote server, and the Arduino plugin will work fine (if you access the webpage
from the same computer that runs the Breakout server. So you can't use a mobile/tablet this way).
You can also run a server locally. We recommend using XAMPP for that because it is free and easy
to use. Here is how:
• Download the installer from here: https://www.apachefriends.org/index.html
• In the "Select components" the only thing you really need is Apache. But we just take it all:
• Install it in the C-root (if you don't, you will have to change the httpd.conf file later on)
---------------------------------------------------------------------------