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

forked from: Arduino/Analog/Fading: physical x wonderfl way

An "Analog/Fading" example in physical x wonderfl way
Output:
* A LED connected the D11 pin
Reference:
http://funnel.cc/Main/GettingStarted
http://arduino.cc/en/Tutorial/Fading
/**
 * Copyright keiso ( http://wonderfl.net/user/keiso )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/aH4Y
 */

// forked from kotobuki's Arduino/Analog/Fading: physical x wonderfl way
// forked from kotobuki's Hello World! with Arduino: physical x wonderfl way
// An "Analog/Fading" example in physical x wonderfl way
// 
// Output:
// * A LED connected the D11 pin
// 
// Reference:
// http://funnel.cc/Main/GettingStarted
// http://arduino.cc/en/Tutorial/Fading

package {
    import flash.display.Sprite;
    import funnel.*;
    import funnel.gui.*;
    import funnel.ui.*;
    
    public class FlashTest extends Sprite {
        private var arduino:Arduino;
        
        public function FlashTest() {
            var config:Configuration = Arduino.FIRMATA;
            config.setDigitalPinMode(11, PWM);
            arduino = new Arduino(config);

            // If you want to create a GUI to let users try
            // without hardware, set a GUI as follows
            var gui:ArduinoGUI = new ArduinoGUI();
            addChild(gui);
            arduino.gui = gui;

//            var led05:LED = new LED(arduino.digitalPin(5));
//            var led06:LED = new LED(arduino.digitalPin(6));
//            var led07:LED = new LED(arduino.digitalPin(7));
            var led08:LED = new LED(arduino.digitalPin(8));
            var led09:LED = new LED(arduino.digitalPin(9));
            var led10:LED = new LED(arduino.digitalPin(10));
            var led11:LED = new LED(arduino.digitalPin(11));
            var led12:LED = new LED(arduino.digitalPin(12));
            var led13:LED = new LED(arduino.digitalPin(13));
 
            // The intercal (in ms), times (0 means infinite)
            // and the waveform.
            // Try Osc.SAW, Osc.TRIANGLE or Osc.SQUARE
//            led05.blink(1000, 0);
//            led06.blink(1000, 0);
//            led07.blink(1000, 0);
            led08.blink(1000, 0);
            led09.blink(1000, 0);
            led10.blink(1000, 0);
            led11.blink(1000, 0);
            led12.blink(1000, 0);
            led13.blink(1000, 0);
        }
    }
}