commit nachricht...joa...aufgabe 1 voll und ganz bewältigt. Note 1++.
parent
946e01ea47
commit
9324341fae
4
Makefile
4
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
|
||||
|
||||
|
|
26
src/main.c
26
src/main.c
|
@ -1,6 +1,30 @@
|
|||
|
||||
#include <avr/io.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue