Arduino & Flash AS3 (part 3)

(continued from Arduino & Flash AS3 (part 2)).

If you have successfully uploaded a sketch to your Arduino, it’s time to configure the Serial Proxy Application.

Install the Serial Proxy application.
After the installation, navigate to the folder where you installed the application and open the serproxy.cfg using your text editor.
Update your file with the following information :

# Example configuration file for serproxy on Mac OS X
# For use with Firmata 2.1

# Do not Transform newlines coming from the serial port into nils
newlines_to_nils=true

# Comm ports used
comm_ports=1,2,3,4

# you will have to change serial_device to reflect your configuration

serial_device1=/dev/cu.usbserial-XXXXXXXX (replace XXXXXXXX with your serial port info)

# Default settings for Firmata 2.0
comm_baud=57600 // this was 115200 it needs to be revised to 57600 to work with AS3 Glue.
comm_databits=8
comm_stopbits=1
comm_parity=none

# Idle time out in seconds
timeout=300

# Set TCP port and serial port
# Port 1 settings (ttyS0)
net_port1=5331

# Port 2 settings (ttyS1)
net_port2=5332

# Port 3 settings (ttyS2)
net_port3=5333

# Port 4 settings (ttyS3)
net_port4=5334

Save and Close the serproxy.cfg file.

*NOTE if you were wondering about the extra port settings, it just means we can connect more than one board to our computer to communicate with the serial proxy.

Our next step is to unzip and include the AS3Glue library in our flash project.

If you haven’t already done so, create a new folder to place you flash source in. I named mine Projects. I also created two more folders inside the Projects folder named source and deploy.

Unzip the AS3Glue Library and navigate to the as3 folder and select and copy the net folder. Paste the net folder into your Project->source folder.

Before we move into the world of Flash, there is one more thing we need to do to prepare our board for communication.
We need to upload the Standard Firmata 2.1 to the Arduino board.

Open up the Arduino IDE, if its not already open. Go to File->Examples->Firmata and select StandardFirmata

Upload the sketch to your board and Close the Arduino IDE.

If you have recently purchased your Arduino Duemilanove Atmega328 and YOU DID NOT have to revise the baud speed in your board.txt file you may move onto (part 4 of this post).

If you did revise your settings, we need to once again update the Firmata file with the correct baud speed to enable the communication.

Navigate to the Applications folder, select the Arduino Application icon and CTRL->Click and select Show Package Contents.

Navigate to Contents->Resources->Java->libraries->Firmata and select Firmata.cpp and open it up with a text editor.

Upon opening search for the method FirmataClass:

void FirmataClass::begin(void)
{
begin(57600);//needs to be updated
}

Update the baud speed to reflect your boards baud speed.
Save and Close.

Re-upload the sketch to your board.
Once it is done uploading Close the Arduino IDE.

Now we should be on track to move onto flash and complete this tutorial.

Part 4 communication.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: