分享

Arduino and Flash (译稿)

 大漠 2012-10-15

Arduino and Flash

(花了我一个晚上的时间,有些浅显的地方就不译了,按个人的理解,匆忙,肯定有不对的地方,请见谅)

Overview 概述

There are 4 main components needed to getting an Arduino to communicate with Flash:实现arduinoflash通讯需要以下四个主要环节

1.       Code to run on the Arduino: This sends data over the USB virtual serial port. Arduino上运行代码:通过USB虚拟串口发送数据。

2.      A Serial to Socket Server(一个串口到Socket的代理服务: This takes data from the serial port and sends it over a network socket负责数据从串口到network socket 的传输. Designed to be used with any client software (Flash etc) and any microcontroller. 通常设计用于任何客户端软件和微处理器。

3.      A Flash Socket Library: Flash Socket库:Actionscript code in flash that accepts and interprets the data coming in from the network socket. You can do this yourself, but why? - most people use an existing codebase. FlashAS代码接受并编译来自network socket的数据,你可以按自己的需要编写,但为什么大多数人使用现存的代码库呢?

4.      Your Flash Code (and Sample code): 你的FLASH代码:You custom actionscript code that does something interesting with the data. 你可以自定义AS代码做一些有趣的事,Some resources have sample actionscript code so you can learn by example. 你可以通过一些开源的例子学习AS代码

NOTE: All of this can also work in reverse - Flash can send data to Arduino.

注意:所有这些也能反向工作:反过来flash也能向Arduno发送数据。

Resources资源

These are below, under the four headings described above: 以下以四个标题来描述

Code to run on the Arduino

Arduino上运行的代码

You can either 可以任选其中之一

·        Make your own, using commands from the 'Serial Communication' section of Arduino Reference Arduino Reference 的串口通讯命令部自己编写,(Serial.print and Serial.read etc).

·        Or use an existing code sample. Some of the resources here have code samples. 利用一些现存的代码例子,有一些资源里有代码例子

There are two Arduino codesets that will be listed here because they are more than just samples - they are designed to be all that you would ever need to upload to the Arduino, after which time, you can just send serial commands to the Arduino to change what it is doing for you. 以下列出两个ARDUINO的代码集,基于它们不仅仅是代码例子,它们被设计成为你只需要上载到ARDUINO,然后每一次只需要发送串口命令到ARDUINO以实现你的设计意图

·        Firmata. Worth serious consideration for most projects. Never upload code to Arduino again - just get your software to send commands that will get Arduino to do what you need. It is being developed as a pseudo-standard, so has support for many software libraries, including Flash 9 (ActionScript 3) - see 'Glue' later. 值得大多数工程认真考虑,不再用反复上载代码到ARDUINO,——仅需要你的程序发送命令给ARDUINO按照你的需求去做,它被作为非标来开发,因而支持大多数软件库,包括Flash 9 (ActionScript 3) - see 'Glue'

·        Arduino > Flash code from Stephen Wilson at SFSU. This is like a simple version of Firmata (above). Also here is a Code library for Director, but does not seem to have anything for Flash.

Stephen WilsonSFSU开发的FALSH的代码,这个像上述简单版本的Firmata,同时也是一个代码库的向导,但看不到任何FLASH东西。

Serial to Socket Server

The list of Serial-to-Network Proxy Servers and details can be found here. Some of the resources here include or have been tested with certain servers. Common ones are: 可以从链接处获得Serial-to-Network Proxy Servers及其细节的列表。这里面包括的资源有些已通过某些服务器的测试。它们是:

·        serproxy. In my opinion, the best option. Simple, fast, robust. Not as simple as TinkerProxy though, so some beginners might want to start with... (note, does not work on Mac OS X 10.6) 在我看来,最好的的选择,简单,快捷、稳定。虽然不像TinkerProxy那样简单,一些初学者还是把它作为学习的开始,(注意,不能工作在MAC操作系统)

·        TinkerProxy. Based on serproxy, but has been updated to work on Mac 10.6. Allows both sending and receiving of Serial data. 基于serproxy,但是已更新,可用于MAC系统。允许双向传输串口数据。

·        SS6 Serial Server. Uses Java, which makes it platform independent, but unfortunately, Java does not support serial port communications without manually installing plugins. This makes it the hardest to set up, and quite slow. However, quite a few people have used this option. 利用JAVA开发,使得它与平台无关,但遗憾的是,如果没有手工安装插件,Java不支持串口通讯,使得这个代理服务较难设置,非常慢。然而,还是有极小部分人选择使用。

·        Arduino2Flash. The author says "Some people using Intel Macs and OS X were unable to get serproxy configured correctly to connect Flash and the Arduino board. To work around this problem, I have written a replacement for serproxy in java called Arduino2Flash. This is experimental code, hacked together quickly, and probably buggy. Please test, let me know if it works, and I'll upload improved versions over time." 作者说“一些使用INTEL MACOSX的用户不能得到serproxy正确设置,以连通FLASH ARDUINO主板。针对这个问题,我写了一个serproxyBJAVA版本,叫做 Arduino2Flash,这是一个实验代码,匆忙应付,可能有很多BUG,请测试,让我知道它的工作情况,过后我会上传修改版本。

·        NETLab Toolkit Hub This is a robust server that supports communication with Arduino (via Firmata), OSC, XBee, and other protocols. It can be used with your own code that connects to it via sockets (it accepts multiple, simultaneous connections that access the same serial connection), or use it with the NETLab Toolkit Flash drag-and-drop widgets (see below). Mac and PC. 这是一个稳定的服务器,支持Arduino (via Firmata), OSC, XBee,和其协议,用于你的代码与SOCKeTS通道连接,(在同一串行连接时接受多个、并行的的访问)或者用与NETLab Toolkit Flash一起使用拖放插件。Mac and PC.均能使用

Flash Socket Library

·        Flash CS3 Binary Socket Example - Flash CS3 and Arduino sketch demonstrating connecting Flash to Arduino using the binary socket and TinkerProxy, from Brett Forsyth. While it has not been designed as a library, its code is short and can be easily used as a starting point.——利用二进制SOCKET TinkerProxy,连接FLASHARDUINOFLASH CS3ARDUINO程序示范,据Brett Forsyth说,当它还没设计成为库的时候,它的代码简短,很容易用作为一个起点。

·        Arduino Flash AS3 communication with Messenger library by Kasper Kamperman - Example based on the SerialPort class from tinker.it. It works together with the basic_communication example from the Messenger library. ?     Arduino Flash AS3 利用消息库进行通讯——Kasper Kamperman,一个基于改善后的串口类的例子,与消息库基本的通讯范例一起工作。

·        Glue - Flex/ActionScript 3 class and sample code for Arduinos with Firmata Arduinos FirmataFlex/ActionScript 3类和代码实例。

·        Arduino > Flash tools from Beltran Berrocal. Uses serproxy. Includes: Beltran Berrocal开发的FLASH工具,利用Serproxy.包括:

o       The 'Arduino.as Actionscript Class v1.0 (30-12-2005)', which uses Actionscript 2. AS的版本

o       A sample flash app using 'Arduino.as Actionscript Class v1.0'. 利用Arduino.as的一个FLASH实例

o       Info on flash communication handling multiple bytes. Flash处理多字节的通讯信息

·        'Flash Arduino IO' - Arduino <> Flash Communication from Kasper Kamperman. Based on 'Arduino.as Actionscript Class v1.0' (AS2) and uses serproxy. A clear and effective implementation. A complete video tutorial (that explains the revised version) can be found at Vimeo. 输入输出通讯,相关教程视频

o       Monitor and set inputs/outputs on Arduino with Flash. 监控和设置输入输出。

o       Sources, documentation and Serialproxy included. 包括源文件、文档、串口代理

o       Download revised version (10-2008) zip : Flash Arduino IO 2

o       Download old version zip : Flash Arduino IO

This is a bit of an exception to the rule - it uses the 'Arduino.as Actionscript Class v1.0' library, but its implementation is so effective and thorough, it can also be used as a library to base a project on. 有一点例外,它利用'Arduino.as Actionscript Class v1.0' (AS2) 库,但它的执行是如此的有效和彻底,它也可以作为库用在工程上。

·        SS6 Serial Server by Dan O'Sullivan. Is the official site of the SS6 Serial Server. It provides a pretty simple 'SS6 Flash Library' (AS1) (under flash tips) that has become quite commonly used. It also provides flash sample code and Arduino sample code. 提供一个非常优秀简单的SS6 Flash Library' (AS1),变得非常通用,也提供一些FLASH实例和ARDUINO代码。

·        MIDAS Serial Component by Tek-Jin Nam & Ji-Dong Yim at Co.design:Inter.action Lab. in the department of Industrial Design, KAIST. It provides flash components (works with AS2.0 and AS3.0 in windows and Mac) to make connection between flash and arduino by serial ports. It also provides installation software and flash sample codes. 提供一些Flash组件连接flashArduino,安装软件和flash例子

·        NETLab Toolkit Widgets A collection of Flash components (AS3) that work with Arduino and other systems via the NETLab Toolkit Hub. The widgets can be configured and used with no coding - just drag and drop, but also have a code interface for more sophisticated applications. Widgets work in a dataflow configuration so that the output of one can feed the input of another. Widgets include AnalogIn/Out, DigitalIn/Out, AudioControl, VideoControl, ClipControl, MIDIOut, DMXOut etc. 收集一些通过NETLab Toolkit HubArduino和其他系统一起工作的flash组件。这些插件不用编译就是可以设置和使用——拖曳   ,但也有代码接口,以便更高级应用。插件工作在一个数据流组态,以便输出端能响应另一个输入端。包括:AnalogIn/Out, DigitalIn/Out, AudioControl, VideoControl, ClipControl, MIDIOut, DMXOut

Your Flash Code (and Sample code)

·        Arduino Flash communication AS3 by Kasper Kamperman Video tutorial on how to setup Arduino with Firmata, Glue (Flash AS 3.0) and Serialproxy (03-2010). Zip-package including Glue, Serproxy, documentation and example files. 如何与几种代理服务器设置的视频教程

·        Intro and samples for simple Flash <> Arduino from Jonah Model. Based on the work of Beltran Berrocal. So uses ''Arduino.as Actionscript Class v1.0' (AS2) and serproxy. 介绍flashArduino通讯的例子

·        'Arduino Vs Flash' Communication from Jowan Sebastian. Uses SS6 Serial Server and 'SS6 Flash Library'. Simple, customisable communication: DIY code + pics + downloads. Example uses: 利用ss6作代理的例子

o       1 sensor into Flash to control a movie clip frame number. 利用传感器控制一个影片剪辑的帧数

o       Simple code that can be adapted to add more sensors. 简单的代码能够适应增加更多的传感器。

o       USB / Serial Comm port and data gets pushed to Flash using Serial to Socket server. 利用串口代理服务把USB/串口和数据发送到flash.

·        Sending Multibyte Numbers from ActionScript to Arduino : Shows how to send multibyte numbers (Number / int (short)) from Flash to Arduino. 显示如何从AS发送多字节数据到Arduino.

·        Flash and Arduino Communication : Shows two way communication between Flash and Arduino using XMLSocket. Flash Arduino之间两种利用XMLSocket 通讯的方法

·        Flash / Arduino Tips, Trick and Gotchas : List of tips and tricks when developing with Flash and Arduino. 一些技巧和方法

Tutorials

·        Adobe Tutorials For Connecting Flash and Arduino : Adobe Software Evangelist Kevin Hoyt explains in a series of video tutorials the hardware and software stacks needed to connect Arduino with Adobe Flash using SerProxy. His approach takes advantage of the powerful sockets features of Flash and a Serial-To-Sockets Module called SerProxy. 一个关于serproxyflasharduino之间的通讯的视频教程

·        Interfacing Flash and Arduino, from scratch : A complete tutorial from Jean-Philippe C?té on how to setup a working Flash/Arduino environment using the Arduino IDE, the FTDI driver, the Firmata sketch, as3glue and SerialProxy/TinkerProxy 2. 接口技术、软件硬件环境等的教程

·        Getting Started with Flash and Arduino : An introductory tutorial written by Mike Chambers that shows how to set up Arduino, TinkerProxy and Flash to communicate with each other. The example code shows how to send and receive information between Flash and Arduino. 如何连接两者,主要是种用TinkerProxy

·        Getting started with the NETLab Toolkit A video and text that introduces using the NETLab Toolkit to connect Flash to Arduino - no code required. 利用NETLab Toolkit连接

 

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多