// Aluno : Victor Filgueiras Santana - Trabalho Semáfaro//
int var = 0;
void function()
{
var = !var;
}
void setup()
{
DDRD = 0xE0;
DDRB = 0x3E;
attachInterrupt(digitalPinToInterrupt(2),function,RISING);
}
void loop()
{
if(var==0)
{
PORTD = 0x20;
PORTB = 0x24;
delay(3000);
PORTD = 0x40;
PORTB = 0x24;
delay(1000);
PORTB = 0x0C;
PORTD = 0x80;
delay(3000);
PORTB = 0x14;
PORTD = 0x80;
delay(1000);
}
else
{
PORTD = 0x80;
PORTB = 0x22;
delay(4000);
function();
}
}