In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

021209: Arduino Basic LED Blink

Get Adobe Flash player
by kotobuki 04 Dec 2009
/**
 * Copyright kotobuki ( http://wonderfl.net/user/kotobuki )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/uR1R
 */

package {
    import flash.display.Sprite;
    import funnel.*;
    import funnel.gui.*;
    import funnel.ui.*;
    
    public class ArduinoBasic_Blink extends Sprite {
        // Arduinoオブジェクト
        private var _arduino:Arduino;
        
        public function ArduinoBasic_Blink() {
            // Arduinoのインスタンスを生成
            _arduino = new Arduino(Arduino.FIRMATA);

            // ArduinoGUIのインスタンスを生成して配置
            var gui:ArduinoGUI = new ArduinoGUI();
            addChild(gui);
            _arduino.gui = gui;

            // ArduinoボードのD13に接続したLEDを1000ms(1秒)周期で点滅
            var led:LED = new LED(_arduino.digitalPin(13));
            led.blink(500, 0);
        }
    }
}