Ok ich probiers mal aus. [Edit] Hat funktioniert, Danke! [/EDIT]
Was sollte ich denn als erstes machen, um voll hinter die ganzen Möglichkeiten durchzusteigen? Wo finde ich eine Übersicht aller Funktionen in C, die ich vorgegeben habe?
Und was ist an folgendem Code falsch?
Code:
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/signal.h>
int main (void)
{
outp(0xFE,DDRA); //PortA: Pin0: Input, Pin1..7: Output
outp(0xFF,PORTA); //PortA: Pin0: pull up, Pin1..7: high = LED off
while(1)
{
if(bit_is_set (PINA,0)) //check if PinA0 is high
{
cbi(PORTA,1); //clear PinA1 = LED on
}
else
{
sbi(PORTA,1); //set PinA1 = LED off
}
}
}
Ausgabe:
Code:
-------- begin --------
avr-gcc (GCC) 4.1.2 (WinAVR 20070525)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiling: test.c
avr-gcc -c -mmcu=atmega32 -I. -gstabs -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.lst -std=gnu99 -Wp,-M,-MP,-MT,test.o,-MF,.dep/test.o.d test.c -o test.o
test.c: In function 'main':
test.c:5: warning: implicit declaration of function 'outp'
test.c:12: warning: implicit declaration of function 'cbi'
test.c:16: warning: implicit declaration of function 'sbi'
Linking: test.elf
avr-gcc -mmcu=atmega32 -I. -gstabs -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=test.o -std=gnu99 -Wp,-M,-MP,-MT,test.o,-MF,.dep/test.elf.d test.o --output test.elf -Wl,-Map=test.map,--cref -lm
test.o: In function `main':
test.c:5: undefined reference to `outp'
test.c:6: undefined reference to `outp'
test.c:12: undefined reference to `cbi'
test.c:16: undefined reference to `sbi'
make.exe: *** [test.elf] Error 1
> Process Exit Code: 2
> Time Taken: 00:00
Lesezeichen