diff --git a/Makefile b/Makefile index e1db116..ee012e0 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -CFLAGS+=-DF_CPU=16000000 +CFLAGS+=-DF_CPU=16000000 -O0 AVR_FUSE_LOW=0xDE AVR_FUSE_HIGH=0xD1 -AVR_FUSE_EXTENDED=0xF0 +AVR_FUSE_EXTENDED=0xC0 DEPENDS=avr-fw-modules/cpu/atmega32u4 diff --git a/bin/.swp b/bin/.swp new file mode 100644 index 0000000..00a8ee5 Binary files /dev/null and b/bin/.swp differ diff --git a/src/main.c b/src/main.c index 39e8d1f..0b5a8b4 100644 --- a/src/main.c +++ b/src/main.c @@ -1,6 +1,30 @@ - +#include int main(void) { + //Taster-pin == input (-> pull-up/ oder nicht) + //if(Taster) -> PORTC = _BV(7) + + DDRC = 0xf0; + PORTC = 0x00; + + DDRE = 0x00; + PORTE = 0x00; + + unsigned long i = 0; + + while(1) + { + if(PINE & 0x04) + PORTC &= ~_BV(6); + else + PORTC |= _BV(6); + + if((i++ % 10000) <= 5000) + PORTC &= ~_BV(7); + else + PORTC |= _BV(7); + } + return 0; }