package { import flash.display.Sprite; import funnel.*; public class GainerTest extends Sprite { private var gio:Gainer; public function GainerTest() { gio = new Gainer(Gainer.MODE1); var externalLED:Pin = gio.analogOutput(0); var osc:Osc = new Osc(Osc.SQUARE, 0.5); externalLED.addFilter(osc); // the on-board button is pressed gio.button.addEventListener(PinEvent.RISING_EDGE, function(e:Event):void { // turn the on-board LED on gio.led.value = 1; // start blinking osc.reset(); osc.start(); }); // the on-board button is released gio.button.addEventListener(PinEvent.FALLING_EDGE, function(e:Event):void { // turn the on-board LED off gio.led.value = 0; // stop blinking osc.stop(); osc = 0; }); gio.analogInput(0).addEventListener(PinEvent.CHANGE, function(e:Event):void { trace("ain 0: " + e.target.value); } } } }