#define F_CPU 8000000UL
#include <avr/io.h>
#include <util/delay.h>
#define testButton PINA & 0b00000001;
#define smokeDetector (PINA & (1<<1));
#define ToggleSmoke (PORTE ^= (1<<4));
int main(void)
{
ADCSRA = 0b11100111;
ADMUX = 0b01100110;
DDRE = 0xFF;
PORTE = 0x04;
while(1)
{
if (testButton)
{
_delay_ms(250);
ToggleSmoke;
}
}
}
I'm in the process of making a smoke alarm program and there is a test button that causes the siren in my microcontroller board (AT90USB87) to sound. However, I keep getting the error as expressed in the question. Is there something wrong with my code or is my IDE tripping? The line in question is line 4, which defines the test button.