Playing with Flash and Arduino

After last months LFPUG with presentations by Matt Biddulph and Alias Cummins I decided to have a play with Arduino and Flash. My Arduino starterkit, I ordered the Arduino Diecimilla USB from tinker.it, arrived only a few days after I had placed the order, so I could get started pretty shortly after. First off, since it’s been a while since I looked at any electronics, the challenge was to decipher what had been sent to me.. resistors, pushbuttons, potentiometer, tilt sensors etc.

The resistor coding is actually extremely simple, once you understand how to read them. The first three band colours simply represents a number; black equals 0, brown 1, red 2, orange 3, yellow 4, so finding a 2.2KOhm resistor is 22*10^2 Ohm and would be red, red, red. The last band is the tolerance (gold or silver).. had I known this before, I would have been able to start working through the examples just a bit quicker. In all fairness it took me a while to figure out how to read this. For 5 band resistors the first 3 bands represent the numeric value, the fourth is the multiplier, and the fifth the tolerance.

Next up, setting installing the Arduino IDE and connecting it to my PC. Simply following the introduction (win) on the arduino website had me set up in no time. With the software downloaded and installed trying out the first tutorial, a blinking led (woohoo!), I thought hooking it all up to flash would be a breeze. No such luck though..

electronics at home

Having installed serproxy which supposedly is the best serial-to-server proxy (more info on flash-arduino comms here) and running the first demo files I ran into a few problems, some of which I haven’t yet solved. I had a look at AS3Glue, with it’s Firmata software (the code that runs on the Arduino) caused a few problems compiling. I still haven’t managed to find the ‘Firmata.h’ library I’m supposed to embed.. However the Firmata code from the arduino site worked fine (it doesn’t require the external libraries).

With the code uploaded to Arduino, it was time to test the connection from Flash. Before I got to this point, I was sent off-track and explored various other ways to connect to Flash, but all with no luck so far. Hardly anywhere is the importance of the correct serial port settings explained, but if you are having problems receiving information through serproxy like I did, it can be a frustrating experience. It appeared my problems were down to my computer assigning serial port 30 to the added USB device (the Arduino). This is no problem in itself, as the Arduino IDE compiles without problems, and the programs run fine on the Arduino.. However, when it comes to serproxy.. It reportedly had problems connecting to any two-digit ports.

So to make a long story.. well.. even longer..
I had changed my hardware configuration, overriden the current port 8, and adjusted the config file for serproxy to reflect the newly assigned port.. et voila! All the Flash-Ardiuno communication now works the way it should! I could have also made the changes to the serproxy i guess, but this was a much easier option for me.

I hope this post helps some of you out there with similar problems getting Arduino to talk to Flash.

On to actually making new things with RFID and Flash, figuring out how to connect, read from and write to the RFID r/w module and antenna I have ordered from sonmicro!

If you have any suggestions getting up and running with the sonmicro/mifare + arduino + serproxy + flash/AS3Glue.. let me know :)

2 Responses to “Playing with Flash and Arduino”

  1. Jwnuke Says:

    Hi This serial to flash looks very cool I am using a PIC microcontroller
    to serial and would like to put a FLASH front-end on it .

    I only have FLASH CS2 though can this work?

  2. elmer Says:

    For Flash8 you mean?
    I’m not aware of an AS2 implementation of glue, but there are other libraries which can be found on interfacing with flash here: http://www.arduino.cc/playground/Interfacing/Flash

Leave a Reply