Hallo forum,
Ich bin ein absouluter noob in sachen Mikrocontrollern kann zwar ein
wenig c++ aber nichts was mir wirklich hilft denn ich lerne ja jetzt C
:D
Ich gehe nach einem Tutorial von der seite mikrocontrollerspielewiese
dort ist ein code gezeit der ein Blinklicht an einem atTiny2313
erstellt(doof formuliert). Nach der Kompilirung erscheint folgene
Fehlermelung
1 | Build started 11.2.2011 at 13:02:08
|
2 | avr-gcc -mmcu=attiny2313 -Wall -gdwarf-2 -std=gnu99 -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT Blinker2313.o -MF dep/Blinker2313.o.d -c ../Blinker2313.c
|
3 | ../Blinker2313.c:6: error: expected declaration specifiers or '...' before numeric constant
|
4 | ../Blinker2313.c:6: warning: return type of 'main' is not 'int'
|
5 | ../Blinker2313.c:19: error: expected identifier or '(' before 'return'
|
6 | ../Blinker2313.c:20: error: expected identifier or '(' before '}' token
|
7 | make: *** [Blinker2313.o] Error 1
|
8 | Build failed with 3 errors and 1 warnings...
|
Leider finde ich im Programm keinen Fehler
1 | #include <avr/io.h>
|
2 |
|
3 | #define F_CPU 8000000UL // 8 MHz (fuer delay.h)
|
4 | #include <util/delay.h>
|
5 |
|
6 | int main(void){
|
7 | DDRD |= _BV(PD5); //PD5 ist jetzt Ausgang
|
8 |
|
9 | while(1){
|
10 |
|
11 | PORTD |= _BV(PD5); // PD5=High -> LED an
|
12 | _delay_ms(250); // Warte 250ms
|
13 | PORTD &= ~_BV(PD5); // PD5=Low -> LED aus
|
14 | _delay_ms(250); // Warte 250ms
|
15 | }
|
16 |
|
17 |
|
18 | return 0;
|
19 | }
|