Hello,
I need help, the interrupti in my program is not working, I tried everything, I read some posts here in the forum, but nothing. I tried to use other pins and it also did not work. Below is the code (Arduino IDE), if you can help me, I thank you!
The code is compiled and uploaded, but not work.
thanks in advance!
I need help, the interrupti in my program is not working, I tried everything, I read some posts here in the forum, but nothing. I tried to use other pins and it also did not work. Below is the code (Arduino IDE), if you can help me, I thank you!
Code:
volatile int estado = LOW; //variavel estado para interrupçao
volatile int PinInt = 15; //Pino de Interrupção
void ligaDesliga(); //Função de interrupção
void setup()
{
attachInterrupt(PinInt, ligaDesliga, RISING); //incializa a interrupção
}
void loop()
{
...
}
void ligaDesliga()
{
static unsigned long antigoMillis = 0;
unsigned long novoMillis = millis();
if(novoMillis - antigoMillis<50)
{ }
else
{
estado = !estado;
antigoMillis = novoMillis;
}
}
The code is compiled and uploaded, but not work.
thanks in advance!