Author Topic: Serial.println(analogRead(inputpin)) and macromedia flash  (Read 2753 times)

0 Members and 1 Guest are viewing this topic.

Offline cloneTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
Serial.println(analogRead(inputpin)) and macromedia flash
« on: January 29, 2009, 11:04:51 PM »
So.. once i've printed to serial a variable such as an analog input.... how can i pick up that variable in macromedia flash to use it in a macromedia flash app??  i've tried to find a SIMPLE way of doing this but all the tutorials for this are very messy and complicated and i just CANNOT figure it out.  could anyone possibly shed some light on this issue for me????? thnx.  heres the link that i started with and cant figure out.

http://www.arduino.cc/playground/Interfacing/Flash

Offline izua

  • Supreme Robot
  • *****
  • Posts: 682
  • Helpful? 0
    • izua electronics
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #1 on: February 06, 2009, 03:18:07 AM »
There is no simple, one click way. Flash is an interpreted language, and you need to connect to your board using either a serial port (and an adequate serial component for flash) or using simpler networking tcp/ip functions, but requiring a more expensive serial to ethernet converter for your board. Writing flash components is not a trivial task, and using network functions without previous experience is impossible.

Your best bet is to look for a serial port class (and hook up your board to a serial port on your pc)
Check out my homepage for in depth tutorials on microcontrollers and electronics.

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #2 on: February 06, 2009, 03:42:57 AM »
@izua the serial to tcp/ip doesn't have to happen on the board, it can happen on the PC. Apparently there's software out there that does it already!

@clone Flash was basically designed for applications that run all by themselves, without any kind of I/O (except keyboard and mouse interaction) - ie: it was designed to make nice flashy advertising! Apparently even if you use one of the serial to tcp/ip adapters you're not done, because Flash can't do TCP/IP by itself either - you need a library for that too. Did you manage to get any kind of interaction between Flash and anything else? I don't really know flash, but for example I'm pretty sure you can load a web page from flash - do you know how to do that? Can you open a text file from flash? (I hope not, that would be a serious security flaw).

Offline cloneTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #3 on: February 06, 2009, 12:41:08 PM »
yea.. u can open webpages from flash, and u can also load external image files, external flash files, external movies etc..   I've just seen it done on youtube so i want to be able to do it too!!

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #4 on: February 06, 2009, 01:02:00 PM »
I wasn't asking for the "cool" factor. If you can open a web page AND access the stuff it returns you can make a serial-to-web-page bridge!
You could have an local exe running side by side with you flash application that connects to the serial port and returns values as HTML pages! It would answer to requests of the form:

Code: [Select]
http://127.0.0.1:8585/get1byte

and return something like this:

Code: [Select]
<html>
<body>
0x12
</body>

The html code sample is made intentionally over-bloated to make a point. If you can't see how this would work then you'd need to steer towards an other easy language, like Delphi, C++, C#, VB, whatever - because making Flash talk to the serial port is all about using things for stuff they're not ment to be used! Remember, flash itself is not made to talk to the serial port, it's made to make safe animation. If an Flash movie would be free to access my serial port whenever it pleases it would be free to use my dial up modem to dial that overtaxed number overseas - and I'd never know it (until the bill comes in :(  ). If you think the dial-up scenario is fantasy, think again, there were some worms out there that did exactly that: dial overseas overtaxed numbers. The problem was so bad it forced Romania's main fixed line telephone provider to stop access to that kind of numbers, to protect it's clients.

Offline cloneTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #5 on: February 07, 2009, 03:37:31 PM »
take a look at this link:
http://www.arduino.cc/playground/Interfacing/Flash

all the info to do it is there.. i just cant figure out how to do it!!!  gah i guess i'll read it again.. :P

Offline cosminprund

  • Robot Overlord
  • ****
  • Posts: 284
  • Helpful? 8
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #6 on: February 07, 2009, 04:08:30 PM »
I already looked at that site. Where did you get stuck? Just start doing it and debug step by step. For example, set up your serial to tcp/ip link using whatever software you like from the list; Connect to your tcp/ip server with telnet and run your AVR code on the MCU - you should see the text displayed in telnet.

Offline cloneTopic starter

  • Jr. Member
  • **
  • Posts: 38
  • Helpful? 0
Re: Serial.println(analogRead(inputpin)) and macromedia flash
« Reply #7 on: February 07, 2009, 05:17:46 PM »
ok.... well, i got it working!!!

I just followed this video step by step
http://www.vimeo.com/1907962

works pretty sweet!!  you can both send and recieve info to / from the arduino board and flash!  yay!!

how it works.. from what i can tell.. is that it uses serproxy to translate the serial data into xml, which flash can understand.  its pretty complex but the bulk of the work is already done for ya!

 


data_list