PIN for external device

Hello.

Quick question: I hava a main board with a serial breakout.
I need to turn on an external device by putting a pin HIGH for two seconds. How can I do it with Xadow?
Do I have the possibility to do this?

Thanks,

Of course you can. See the following demo, press the button (high level) for more than 5s and the led will be turn on. if the pressing time is between 1s and 5s, the led will be turn off. If the time is less than 1s, nothing happen. :ugeek:

unsigned long time;
unsigned long time1;
#define led 3
#define button 2
unsigned long sum;

void setup(){
  Serial.begin(9600);
  pinMode(3,OUTPUT);
  pinMode(2,INPUT);
  digitalWrite(3,LOW);
}
void loop(){
  int i=digitalRead(2);
  Serial.println(i);
  if(i==HIGH)
  {
    time = millis();
    while(digitalRead(2)==HIGH)
     {
     }
    time1=millis();
    sum=time1-time;
    if(sum>=5000)
     {
       digitalWrite(3,HIGH);
     }
     else if( (sum>=1000) && (sum<5000) )
     {
       digitalWrite(3,LOW);
     }
     else
     {
     }
  }   
}