#include <avr/io.h>
#include <avr/delay.h>
#include "macros.h"
#define LED_ON setBit(PORTB,Bit5)
#define LED_OFF clearBit(PORTB,Bit5)
#define LED_TOGGLE toggleBit(PORTB, Bit5)
#define PRESSED checkBit_0(PINB, Bit4)
int main(void)
{
// PortB initialisieren
DDRB = 0b00100000;
PORTB = 0b00010000; // Pullup ON
// Hauptschleife
while(1)
{
if (PRESSED)
{
// LED_ON;
LED_TOGGLE;
}
else
{
LED_OFF;
}
_delay_ms(250);
}
}