Urgent - analog pin as digital input with flash

Hi all,

I want to use analog analog pin as digital input pin in as3 as i ran out of digital pins.

I can use it in arduino IDE by writing,


pinMode(14, INPUT);
digitalRead(14, HIGH);


but how can i use it in as3? It is not working with flash. I used the following code in as3,


import net.eriksjodin.arduino.Arduino;
import net.eriksjodin.arduino.events.ArduinoEvent;

var a:Arduino;
a = new Arduino("127.0.0.1", 5331);
a.addEventListener(Event.CONNECT , onSocketConnect);
a.addEventListener(ArduinoEvent.FIRMWARE_VERSION , onReceiveFirmwareVersion);
a.addEventListener(ArduinoEvent.DIGITAL_DATA, onReceiveDigitalData);

function onSocketConnect(e:Event):void
{
a.requestFirmwareVersion();
}

function onReceiveFirmwareVersion(e:ArduinoEvent):void
{
a.setPinMode(2,Arduino.INPUT);
a.setPinMode(14,Arduino.INPUT);

}

function onReceiveDigitalData(e:ArduinoEvent):void
{
trace(e.pin , e.value);
}


As you can see in the code I am also using digital pin 2 and it works with the digital pin 2 but its not working with digital pin 14.

I want to analog pin 0 (digital 14) to detect motion form a digital PIR sensor (high and low) without expander. I think I am missing something in flash code.

Waiting for your quick replies. I am in real urgent at this moment.

Thank you all in advance.

Cheers !!

what code and libraries are you using?

digitalRead(14, HIGH);

I have no idea what the outcome of that piece of code will be, but you certainly can't read something "HIGH". You can either write it high, or read it.

Cross-posting:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1275034557/0#0