sadpony
Junior Member level 2
Code:
int pinTx=12;
volatile int state=HIGH;
void setup()
{
pinMode(pinTx,OUTPUT);
attachInterrupt(0,tx,FALLING);
}
void loop()
{
digitalWrite(pinTx,state);
if(state==LOW)
{
delay(1000);
digitalWrite(pinTx,HIGH);
}
}
void tx()
{
state=LOW;
}
Last edited by a moderator: