2013年12月18日 星期三

Android APK 反編譯 為Java檔

若要參考別人的原始碼來學習,

一種方式就是將APK檔 反編譯回 JAVA檔,

此種方式需先下載兩個檔

分別是

dex2jar

JD-GUI

首先先將 手上的apk檔 把副檔名改成壓縮檔(zip or rar...),

再將此壓縮檔解壓縮出來,你會看見有一個classes.dex檔,

我們要將此.dex檔轉成jar檔再透過JD-GUI反編譯為原始的java程式碼。

下載完dex2jar後,到dos下執行指令

dex2jar.bat  classes.dex

接下來你會看見classes.dex.dex2jar.jar的檔生成在dex2jar.bat這個目錄之下。

接下來再去執行 JD-GUI 將這個jar檔開啟..所有的程式碼就出現囉..

2013年10月30日 星期三

Couldn't register xxx.xxx with the bootstrap server. Error: unknown error code.

今天用iphone實機來debug, 

 後來發現程式居然一直傳不上去手機 

 明明就沒動到什麼 而出現以下error

Couldn't register 我的package名稱 with the bootstrap server. Error: unknown error code.
This generally means that another instance of this process was already running or is hung in the debugger.

後來查了查 原來只要將 你的iPhone重新開機就可以了

2013年10月23日 星期三

GoogleMaps.framework/GoogleMaps for architecture armv7s 錯誤


今天在發佈Google Maps API for iOS version 1.4.3版本時

發現在模擬器上跑可以正常發佈,

但要裝到實機一直出現以下error

ld: file is universal (2 slices) but does not contain a(n) armv7s slice: mypath.../  GoogleMaps.framework/GoogleMaps for architecture armv7s

卡了很久 最後終於查到是armv7s架構出的問題,

因為我是發佈到ios5.1版本,

需把armv7s刪除。

到 Project -> Build Settings -> Valid Architectures 裡 把armv7s刪除,

就可以正常發佈到iOS5.1的手機上囉~

2013年10月22日 星期二

ios 5 Could not instantiate class named NSLayoutConstraint問題

在 iOS 5 不支援 AutoLayout的功能,

若在storyboard或xib上建立 預設通常會把AutoLayout打勾,

但你用iOS5來發佈就會出現

Could not instantiate class named NSLayoutConstraint

的錯誤訊息。

只要將AutoLayout打勾取消即可解決此問題

2013年10月21日 星期一

ios google map api 出現 NSInvalidArgumentException', reason: '+[GMSCameraPosition .. error

今天在開發使用Google Maps API for iOS

出現以下error 2013-10-22 10:13:52.736 HM[1155:12e03] +[GMSCameraPosition cameraWithLatitude:longitude:zoom(inlove): unrecognized selector sent to class 0x3305b0 2013-10-22 10:13:52.737 HM[1155:12e03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[GMSCameraPosition cameraWithLatitude:longitude:zoom(inlove): unrecognized selector sent to class 0x3305b0' *** First throw call stack: (0x273f012 0x2564e7e 0x27ca2ad 0x272ebbc 0x272e94e 0x6cf6f 0x158a1c7 0x158a232 0x158a4da 0x15a18e5 0x15a19cb 0x15a1c76 0x15a1d71 0x15a289b 0x15a2e93 0x15a2a88 0x18fee63 0x18f0b99 0x18f0c14 0x2578705 0x14ac2c0 0x14ac258 0x156d021 0x156d57f 0x156c6e8 0x14dbcef 0x14dbf02 0x14b9d4a 0x14ab698 0x3216df9 0x3216ad0 0x26b4bf5 0x26b4962 0x26e5bb6 0x26e4f44 0x26e4e1b 0x32157e3 0x3215668 0x14a8ffc 0x2dbd 0x2ce5) libc++abi.dylib: terminate called throwing an exception

主要解決方案是 到
Project → Build Settings → 搜尋 Other Linker Flag → Other Linker Flags -> 加入 -ObjC

這樣就可以解決此問題。

不過 接下來又出現一個問題,

就是

GMSServicesException', reason: 'GoogleMaps.bundle requires Google Maps SDK for iOS to be part of your target under 'Copy Bundle Resources''

的error

此error只要將你Frameworks裡的
GoogleMaps.framework 右鍵→show in finder -> Resources → GoogleMaps.bundle拉到

Frameworks的資料夾 我是沒有將copy items into destination groups folder 打勾,

因為GoogleMaps.framework已經copy items在project裡頭了~

2013年10月15日 星期二

Android GCM問題 -- GCMIntentService (has extras) }: not found

這個問題卡了我好久多天

Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTRATION flg=0x10 pkg=   cmp=xxx.xxx.xxx  /.GCMIntentService (has extras) }: not found


通常GCMIntentService都會存在根目錄(root)之下,
所以android的gcm去抓GCMIntentService是去抓root的file,


但如果的project有許多package name的話,


你必須要去修改 GCMBroadcastReceiver 回傳GCMIntentService的class package name,



所以要自訂一個GCMReceiver去繼承GCMBroadcastReceiver,

並Override 掉 getGCMIntentServiceClassName 回傳你的GCMIntentService的package name,



再去修改AndroidMainfest.xml 的receiver android:name 與service android name



您可以參考 這篇:

http://stackoverflow.com/questions/12089428/gcm-with-custom-broadcastreceiver



http://dexxtr.com/post/28188228252/rename-or-change-package-of-gcmintentservice-class

2013年10月2日 星期三

google-play-services_lib/bin(missing) 錯誤問題

原本要來試 Google Play Services的功能,

但第一步居然就讓我卡關卡了幾天= =

使用Google play services 需要先到AVD安裝Google Play Services 的SDK,

然後再到eclipse內 import->android->existing android code into workspace

匯入google play services的專案,

專案路徑是在你Android SDK的資料夾/extras/google/google_play_services

把此專案import後,

重點是在你自己的專案按右鍵->Properties ->Android->Add->會看見google-play-services-lib的專案,點選他,

若您沒有看見就是前面的步驟有誤。

記得is Library不需要打勾,

照理說這樣就可以很容易的使用到Google play services的lib了,

可是在發佈時會出現

google-play-services_lib/bin(missing) 錯誤問題

最後我的解決方案是

按下我的專案右鍵->java compiler->enable project is specific打勾

把compiler compilance level: 1.6先改1.7 按下確定後

再按專案右鍵  android tools->fix project properties

然後發佈看是否能成功編譯

成功的話再將1.7再改回1.6 重新再做一次fix project properties

然後也把專案project->clean

這樣就正常了= =

感覺是eclipse的問題..

以上是我個人試成功的經驗,不一定是最正確的方式~提供參考

=============2013.10.07===============
今天又遇到此問題

以上方式還是出現一樣error

後來嘗試把jar檔通通移除重新加次一次就可以囉~





2013年10月1日 星期二

更新ADT後發出 Multiple dex..錯誤解決方案

昨日更新了ADT,

把之前的專案發佈一直出現以下error,

花了一個小時才解決..


Dex Loader] Unable to execute dex: Multiple dex files define Lorg/kobjects/isodate/IsoDate

我的解決方式是將jar檔刪除,重新加入一次,

然後記得不要加到沒有用到的jar檔,

我把android-support-v4.jar拿掉,

重新發佈問題就解決了~

2013年9月13日 星期五

laser marker 找不到javax.vecmath library問題

首覺感謝有人在背後為我打氣

讓我有動力去解決一些問題:)

如果去找雷射塗鴉的processing程式 ( http://blog.graffitiresearchlab.at/ )

會發現抓下來的programe會無法compile

會出現 javax.vecmath library missing的問題

這個原因就是少了java 3d的library

先到sun抓java3d  

抓完安裝後  會發現還是無法compile

我用windows平台

我們到C:\Program Files\Java\Java3D\1.4.0_01\lib\ext 裡頭 將.jar 檔copy起來

再到processing的程式

processing-1.0.7\libraries\vecmath\library

如果你的libraries裡沒有vecmath的資料夾 就自己建一個

把剛才copy的 .jar檔通通丟到library裡

再將processing重新開

就可以順利run  laser marker的program 囉:)

May 23, 2010

NXT機器人

下午組裝了這套NXT

似乎不太便宜的玩具

跟樂高一樣 有點像回到小時候

還滿有趣的玩具

可以把程式寫入

拍了幾張相片

不過我只有裝超音波感應器 和光感應器上去










下面這個是我錄下來的

下午把程式寫入後

前面有人他就會自動後退

就像有人要抓他一樣XD很好玩

下午時間不夠不能多玩點

今天先這樣巴

February 26, 2009

特效:P

這個3D作品呢

是投影機的效果 :P

也是用3Ds MAX製做的唷





投影絃樂社的相片XD


而這個是火焰的效果


February 25, 2009

失敗的椅子

看著CG cookie的教學

做了失敗的椅子

沒有做完 但就這樣放棄他了

不知道為啥做這張椅子電腦跑特別慢

慢到一種我想揍人的地步= =

就這樣吧..不管他了= =+



February 25, 2009

沙發打燈

太酷了

剛才看了JC Design的教學

矩陣式燈光打法

把他提供的檔案小房間原本有小椅子

將上次自己做的沙發merge進去

然後開始自己嘗試他所教學的燈光矩陣式打法

用了上百個燈光 快昏倒

打了一個晚上的燈光 雖然沒有和他的教學完全一樣

但大至少要的效果成功了


好開心 又學到一課了★,:*:‧\( ̄▽ ̄)/‧:*.°★
下面這是黑色版本 ^o^




February 22, 2009

沙發

★,:*:‧\( ̄▽ ̄)/‧:*.°★

我又有新作品了 嘩哈

不過是沙發椅

把老師教的改編了一下

變一、二、三 套裝組沙發

不過我沒有對沙發上材質 

我不會用沙發狀的材質

大多都用鏡面來反射

記得要用鏡面的話要用Raytrace哦~

不過目前我還是很新的新手~~才學三堂課而已XD 


February 21, 2009

材質

今天終於教到材質和打光

短短三個小時

感覺只有教到一點點

但大約會使用這些工具 

其它只能自己K書了 

誰叫這個算是先修班

老師沒法教太多 時數不夠

這個是上了材質












上燈光


上投射燈的燈光


上方向燈的燈光 應該是說上日光燈才對


這個叫泛光燈@@a


這是三角打燈法@@但看不太出來差哪邊 
還有加上一個透明box的練習


February 20, 2009

3Ds MAX Design 2009

超級初學者

不過有點小作品XD

雖然很爛 哈

不過也才上兩堂課而已

打光不會打 自己亂打 老師還沒教

材質也還沒學 

色彩亂配一通XD

自己開心有進度就好

這是最基礎第一個杯子練習





 這是房子?XDDa


做的螺絲釘 長的很奇怪=v=


 自己練習的時鐘


ARToolkit 與OpenGL於Visual C++6的設定

到ARToolkit官網選download
http://www.hitl.washington.edu/artoolkit/download/#windows
下載
  • ARToolkit-2.71.2.tgz (988KB)
  • DSVL-0.0.8b.zip (2.57MB)
  • OpenVRML-0.14.3-win32.zip (10.8MB)
這三個檔案
點選官網 ARToolKit-2.72.1.tgz  下載完會發現副檔名是.gz
解壓縮出來是沒有副檔名的
自行加上副檔名改為.tgz  
又會變成另個壓縮檔
將他解壓縮即為ARToolkit的程式

接下來AR需要OpenGL支援
ARToolkit官網沒有提供
所以到
http://www.xmission.com/~nate/glut.html
下載glut-3.7.6-bin.zip

然後將glut-3.7.6-bin.zip解壓縮後
把下面資料放置WIndows XP相關資料夾裡

glut32.dll 放在C:\windows\system32

glut32.lib放在C:\Program Files\Microsoft Visual Studio\VC98\Lib

glut.h放在C:\Program Files\Microsoft Visual Studio\VC98\Include\GL

C:\Program Files\ARToolKit加入DSVLOpenVRML資料夾

C:\Program Files\ARToolKit\DSVL\bin\DSVL.dll
C:\Program Files\ARToolKit\DSVL\bin\DSVLd.dll
C:\Program Files\ARToolKit\OpenVRML\bin\js32.dll

以上三個DLL放到C:\Program Files\ARToolKit\bin裡

點兩下Configure.win32.bat

==================================================
在Visual C++6的設定


tool→options→directories:
Include files中加入C:\PROGRAM FILES\ARTOOLKIT\INCLUDE

Library files中加入C:\PROGRAM FILES\ARTOOLKIT\LIB

打開C:\Program Files\ARToolKit\ARToolKit.dsw

點選
build-batch build
→build


project seeting:
【input】

Object/library modules:
libAR.lib libARgsub.lib libARvideo.lib libARmulti.lib libARvideod.lib libARgsub_lite.lib 
 

ignore libraries:
libcmt.lib

Additional library path:
C:\Program Files\ARToolKit\lib


C/C++:
Category:【preprocessor】
Additional include directories:
C:\Program Files\ARToolKit\include

Debug:
working directory:
C:\Program Files\ARToolKit\bin



http://flash.tarotaro.org/blog/2008/12/14/artoolkit-marker-generator-online-released/

混種

!!! 這什麼動物!!?? 犀牛 帶著 豹皮 豹與犀牛的混種就變成這樣了 其實這是上課練習的作品啦 用photoshop裡的濾鏡、液化、遮色片、影像色階調的 純練習用 其實在photoshop和之前跟郝老師學的photoshop還是有些許的不同 兩邊著重的重點不太一樣 幸運的事我都有學到兩邊的

Arduino 與 Flash as3連接


Rich Text Area. 離上次發文章是去年了也  

時間過真快

看來記錄些東西是必要的

之前記錄了Flash 接 arduino也是在去年的事 

那時好像也沒有真的接出來

今年這個時候又要用到結果一直沒有解答

網路找的範例怎都try不出來喏@@~

後來認真的思考自己寫一個  不知是自己進步了還是巧合呢(笑)

其實也沒有很難 囧..但花了我一些時間找資料

arduino  <-------> Flash 要透過中介軟體

因為Flash好像不能讀Serial的資料?! (有錯請指正)

中介軟體找到兩種

一種為 TinkerProxy (紅色背景的中介小程式)  但我一直沒找到這個軟體 =.=

後來死心改回找serproxy  我用0.1.3版的 ,其他0.1.1好像也可以通啦 

然後第一步就是要先傳pde檔到arduino

pde的內容是什麼呢

以下為基本的範例 就是我們用Flash AS3來讀可變電阻的類比數值讓他顯示在Flash上囉

==================先用Arduino程式 upload 這個pde檔=======================



int potPin = 0;    
int val = 0;     

void setup() {
  pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT
  Serial.begin(9600);
}

void loop() {
  val = analogRead(potPin);    
  Serial.print(val,DEC);
  delay(100);
  Serial.print(0,BYTE);
  delay(100);
  
}

===============================================================
網路找的範例很多都是寫printByte 那個要改成Serial.print
Serial.print(val,DEC);
Serial.print(0,BYTE);
好像不能用println的樣子 我忘記了  好像跟那個XML有關

第二步呢  
就是要執行serproxy
如果不是0.1.3版的好像要改裡面的port和net_port的值

我的serproxy.cfg的內容長這樣 0.1.3好像不用改

=====================
# 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

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

# Default settings
comm_baud=19200
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

===============================
也就是說上面只支援到Port 4

你要先看一下裝置管理員裡面 你USB的port到幾
如果超果4的話 
請在裝置管理員COM和LPT的USB Serial Port按右鍵→內容→port setting→advanced→com port number選4以內
這樣後面比較不會麻煩啦

上面燒pde進arduino後
再來開serproxy的軟體 
這個中介軟體不可以關唷

再來就是Flash AS3的部份了!!!

這個as3檔也是網路找的
開一個Arduino.as放以下內容
===============================================================================
/* 
*    Class : Arduino v1.0 - 30-JAN-2008
*      This Actionscript3 class makes it easier to connect Flash to the Arduino Board (www.arduino.cc)
*    And, this script is based on beltran berrocal's ARDUINO CLASS v1.0(written in AS2).
*    # copyleft Mr. Excuse, 2008 - mrexcuse@hotmail.com
*    # visit http://november.idv.tw for more information.
*    If you need AS2 version, see www.progetto25zero1.com/b/tools/Arduino
*
*     # credits must also be given to:
*    Yaniv Steiner and the instant soup crew (instantsoup.interaction-ivrea.it) for generating the original flash client
*
*      # you will also need the serialProxy developed by Stefano Busti(1999) and David A. Mellis(2005)
*    that can be found either on the Arduino Site (www.arduino.cc) or redistributed with this example (see update url)
*
*---------------------------------------------------------------
*
*   # METHODS & DESCRIPTIONS
*
*    @@ CONSTRUCTOR
*    @@ creates the Arduino Object inside Flash 
*                usage:
*                        var var ArduinoInstance:Arduino = new Arduino([port], [host]);
*
*                        // port: default is 5331, read the serialProxy documentation to understand this
*                        // host: default is "127.0.0.1"
*    
*    @@ CONNECT
*    @@ connects to the XMLSocket server, you must have provided a port and a host adress via the constructor
*                usage:
*                        ArduinoInstance.connect()
*    
*    @@ DISCONNECT
*    @@ disconnects from the XMLSocket server
*                usage:
*                        ArduinoInstance.disconnect()
*    
*    @@ SEND
*    @@ sends data to Arduino via the XMLSocket server(the serialProxy)
*                usage:
*                        ArduinoInstance.send("some data here");
*    
*    ## EVENT: onDataReceived
*    ## handler of a listener object that listens to data sent from Arduino through the XMLSocket server(the serial Proxy)
*                usage:
*                        Arduino_Listener = new Object(); //create a listener object
*                        Arduino_Listener.onDataReceived = function() { 
*                                //handle the received data in here
*                        }
*                        ArduinoInstance.addEventListener("onReceiveData",Arduino_Listener); //register to listen to the events
*    
*    ## OTHER EVENTS: onConnect,  onConnectError,  onDisconnect
*                usage: use in the same way as the onDataReceived event
*
*-----------------------------------------------------------------------------
*    LICENCE
*   Copyright (C) 2008 Mr. Excuse  |  mrexcuse@hotmail.com
*   http://november.idv.tw
*
*   This library is free software; you can redistribute it and/or modify it 
*    under the terms of the GNU Lesser General Public License 
*    as published by the Free Software Foundation; either version 2.1 of the License
*    
*   You should have received a copy of the GNU Lesser General Public License along with this library;
*   Alternatively you can find it here http://www.gnu.org/licenses/lgpl.html
*    
*   Brief Explanation of the Licence:
*   - you can you use, redistribute, modify this software for free,
*    - you can put it into commercial projects
*   - but if you modify/enhance this Library you should release it under the same licence or alternatively under the GPL licence
*   - in all cases you should also credit the original author and all contributors
*
*-----------------------------------------------------------------------------
*/
package {
    //import mx.events.EventDispatcher;
    import flash.display.Sprite;
    import flash.net.XMLSocket;
    import flash.events.*;


    //class Arduino extends XMLSocket {
    public class Arduino extends XMLSocket{
        
        private var _connected        :Boolean = false;        // 是否已連結
        private var _host        :String  = "127.0.0.1"; // 主機名稱或是IP位址
        private var _port            :int  = 5332;        // 設定連結埠號
        //private var socket            :XMLSocket;
        
            
    //constructor - provide a port number and a host ip adress
    //read the documentation of the SerialProxy to better understandwhat this means
        public function Arduino(port:int = 5331, host:String = "127.0.0.1") {
            //initialize
            
            //socket = new XMLSocket();
            super();
            //flash.events.EventDispatcher.initialize(this);
            
            if((port < 1024) || (port > 65536)){
                trace("** Arduino ** Port must be from 1024 to 65535 ! read the Flash Documentation and the serProxy config file to better understand");
            }else{
                _port = port;
            }
            
            
            
            //check for host or set default
            //if(strHost != undefined) {
                _host = host;
            //}
            
            //register and override responder functions
            //this.onConnect  = onConnectToSocket;
            //this.onClose    = onDisconnectSocket;
            //this.onData        = onDataReceived;
            
            
            // 重新設定監聽者
            configListener(this);
            
            //autoconnect
            xconnect();
        }
        
        // 重新設定監聽者
        private function configListener(dispatcher:IEventDispatcher):void{
            dispatcher.addEventListener(Event.CLOSE, closeHandler);
            dispatcher.addEventListener(Event.CONNECT, connectHandler);
            dispatcher.addEventListener(DataEvent.DATA, dataHandler);
            dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
            //dispatcher.addEventListener('onData', onDataReceived);
            //dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
           // dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
        
        }
        
        //---------------------------------------
        //    CONNECT and DISCONNECT + responders
        //---------------------------------------
        
        //connect to the XMLsocket
        public function xconnect ():void {
            super.connect(_host, _port);
        }
        
        //disconnects from the xmlsocket (not Arduino itself)
        public function disconnect () {
            if (_connected)    {
                super.close();
                _connected = false;
            }
        }
        
        // connect handler
        private function connectHandler(event:Event):void{
            trace("** Arduino ** Connecting to "+_host+":"+_port+" . . .");
        }
        
        // close handler
        private function closeHandler(event:Event):void{
            trace("** Arduino ** disconnected");
        }
        
        // data handler
        private function dataHandler(event:DataEvent):void{
            //trace("dataHandler:" + event.data);
            //dispatchEvent('onData');
            //onDataReceived(event.data);
            //e_onReceiveData(str);
            
        }
        
        // io error handler
        private function ioErrorHandler(event:IOErrorEvent):void{
            trace ("** Arduino ** Connection failed! you must launch the serialProxy first");
        }
        
        
        //---------------------------------------
        //    SEND and receive data from server
        //---------------------------------------
    
        /*
        //sends data to arduino
        override public function send(dataStr:String) {
            trace("** Arduino ** send:" + dataStr)
            if (_connected) {
                if (dataStr.length) {
                    trace("** Arduino ** Sending \""+dataStr+"\"");    
                    super.send(dataStr);
                }
            }            
        }
        */

        //overrides XMLSocket.onData in order to have pure string and not the full XML object
        private function onDataReceived (str:String) {
            //trace("** Arduino ** onDataReceived str:"+str);
            //launch event
            e_onReceiveData(str);
        }

        
        
        /*
        //---------------------------------------
        //    EVENTS
        //---------------------------------------
        
        private function e_connectToSocket(){
            var evt = {target:this, type:"onConnect"};
            dispatchEvent(evt);
        }
        
        private function e_connectToSocketError(){
            var evt = {target:this, type:"onConnectError"};
            dispatchEvent(evt);
        }
        
        private function e_disconnectSocket(){
            var evt = {target:this, type:"onDisconnect"};
            dispatchEvent(evt);
        }
        */
        private function e_onReceiveData (str:String){
            trace("** Arduino ** onDataReceived str:"+str);
            var evt = {target:this, type:"onReceiveData"};
            evt.data = str;
            dispatchEvent(new Event(evt));
        }
        
    }
}

===================================================================
記得  上面有一行 
private var _port            :int  = 5332;        // 設定連結埠號

這個部份要改
像我是Port 2所以是5332

如果你是Port 3 就要改5333唷

再來請開啟你的fla檔囉~
先建一個動態文字欄位
把屬性名稱命名為:arduinoval
然後到影格按F9開啟動作面版
把以下程式打進去
====================================================================
//建立port :port2→5332
//中介軟體也的也要改
var test:int=0;
var a:Arduino = new Arduino(5332); 
a.addEventListener(DataEvent.DATA, receiveData);

//接收Arduino傳的數值
function receiveData(event:DataEvent):void{
    trace(event.data);
    arduinoval.text=event.data;

}

======================================================================
記得上面的5332也要改成你的Port對應的net port號碼
然後按下ctrl enter發佈 
轉轉你的可變電阻就可以看到類比數值囉^___^
至於可變電阻的線路圖就麻煩自己找資料了
我的是插analog in 0
其他就5V和GND
至於深入的部份
就看AS3功力怎麼設計囉:P