Hi there! Back from the holidays with an update on getting started with Arduino and serial communication. In this case communication with the Adobe Flash player. For all the details please watch both Flash videos linked below. You can refer back to this post with the links for the dependencies below as well. Also, there is serial debugging built into the Arduino IDE – as a separate project I will look at how to integrate that into the process, for now the external monitor ( serproxy ) is what I used. Enjoy!
The Environment:
Environment: Mac OS X Snow Leopard ( 10.6.2 )
Arduino: Arduino Duemilanove 328
Flash: CS4, ActionScript 3, Debug Player 10.0.42.34
Arduino IDE: 0017
FTDI Drivers: 2.2.14
AS3 Glue: v2_beta2
Firmata: Firmata-2.1 beta7
Serial Proxy: SerProxy-0.1.3
The Dependencies:
Serial Proxy Config:
# Config file for serproxy
# See serproxy's README file for documentation
# Transform newlines coming from the serial port into nils
# true (e.g. if using Flash) or false
newlines_to_nils=true
# Serial Devices on each port
serial_device1=/dev/cu.usbserial-A9007Vp3
# Comm ports used
comm_ports=1,2,3,4
# Default settings
comm_baud=57600
comm_databits=8
comm_stopbits=1
comm_parity=none
# Idle time out in seconds
timeout=300
# 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
The Example:
* Make sure to change the publish settings in the demo Flash file to point to your classpath of where you extract/download the AS3 Glue library.
Compressed Flash CS4 example (download and unzip)
The Screen-Casts:
* Apologies for the rushed ending of the 2nd part of the walkthroughs… I had to wrap up before the 5 minute time limit on the trial version and didn’t want to push it to a 3 part series!
Part 1: ( Dependencies & Setup )
Watch It
Part 2: ( Configuration & Demo )
Watch It
Hi john,
Thankyou for the tutorial, i found it very easy to understand.
I have been trying to get my arduino to talk to flash all week and still no luck, I am running Leopard on my macbook and your example flash file doesnt seem to be downloadable. Would you possibly be able to repost the link or send it to me.
I would be eternally grateful as i think i may be starting to go mad.
Thanks once again.
Dan
Hello again, I have figured out how to get your flash file to work, but it has come up with an Error message
Scene 1, Layer’Layer 1′,Frame 1, 1046: Type was not found or was not a cc function onReceiveFirmwareVersion(e:ArduinoEvent):void{
Where am I going wrong
Any help would be greatly appreciated as I have a uni deadline in two weeks.
Thanks
Dan
@Dan Wilkinson
Hi there, thanks! The downloadable fla file had a .txt extension somehow being appended, so if you remove that and keep the .fla it should work for you ( It appears that you already figured that out )
To address the other issue, first double-check that these imports are included at the top of the Actions-Frame panel:
Then…make sure you have assigned the classPath for that Flash file to point to the location on your drive where you downloaded the AS3Glue library. It sounds like the compiler is not finding the reference to the ‘ArduinoEvent’ class because the path to the library source is not correct. Let me know how you make out.
Hope that helps and good luck with your project!
Update: The Flash project file MIME type has been fixed. Downloading it should no longer append the ‘.txt’ to the FLA file. I ended up compressing both the Flash FLA and SWF into a project directory.