Paja

Icon

Rapid prototyping for music, art and design work

How to connect Flash to external sensors using Processing and an Arduino board

The Flash meets Processing Meets Arduino setup

In the example, we use an Arduino board to receive analog signals from 3 sensors, and send them to the computer’s serial port.

A simple Processing application listens to the serial port, and creates an XML socket where it sends the signals it receives.

The Flash application listens to the XML socket created in Processing, and when an event occurs, a function is launched to process the received data.

Below are example snippets for each part of the solution:

Arduino code example
Processing code example
Actionscript code example

The Flash game shown at the presentation

The game sources (fla+arduino+processing)

– Viljo Malmberg, Aleksi Hyvönen and Brian Mogensen

Social links powered by Ecreative Internet Marketing