Hallo Zusammen!
Ich habe 2 Fragen
1. Ich habe ein fertiges Programm im Internet gefunden für asuro ultraschall.
Bei Übertragung dieses Programms bekomme ich viele Fehlermeldungen.Kann mir jemand helfen?
hier ist der Code:
Ultraschall
#inlude "asuro.h"
void LocalInit(void)
{
TCCR2=(1<<WGM21) | (1<<CS20);
OCR2=0x64;
ADCSRA=0x00;
ACSR=0x02;
ADMUX=0x03;
SFIOR|=(1<<ACME);
DDRD&=~(1<<6);
}
void Ping (unsigned char length)
{
count 72kHz=0;
TCCR2 = (1<<WGM21) | (1<<COM20) | (1<<CS20);
while (count72kHz<length)
{
OCR2=ox64+length/2-count72kHz;
}
TCCR2 = (1<<WGM21) | (1<<CS20);
OCR2=0x64;
}
int main (void)
{
int pos,i;
int posmarker;
Init();
LocalInit();
while(1)
{
posmarker=0;
Ping(20);
for (pos=0; pos<100; pos++)
{
Sleep(10);
if ((ACSR&(1<<ACI))!=0)
{
if (posmarker==0) {posmarker=pos;}
}
ACSR|=(1<<ACI);
}
if (posmarker>10)
{
StatusLED(Green);
MotorDir(FWD,FWD);
MotorSpeed(100,100);
}
else
{
StatusLED(RED);
MotorDir(FWD,RWD);
MotorSpeed(0,100);
for (i=0; i<100; i++) {Sleep(200);}
}
}
return 0;
}
PS : bei Übertragung bekomme ich diese Meldung:
> "C:\Dokumente und Einstellungen\Administrator\Desktop\ASURO_src\Firs tTry\Test-all.bat"
C:\Dokumente und Einstellungen\Administrator\Desktop\ASURO_src\Firs tTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
test.c:2:25: error: ultrasonic.h: No such file or directory
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
test.c:2:25: error: ultrasonic.h: No such file or directory
-------- begin --------
avr-gcc --version
avr-gcc (WinAVR 20100110) 4.3.3
Copyright (C) 2008 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.
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
In file included from asuro.h:34,
from asuro.c:29:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
In file included from asuro.h:34,
from test.c:1:
c:/winavr-20100110/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
test.c:2:25: error: ultrasonic.h: No such file or directory
test.c:3: error: expected identifier or '(' before ',' token
test.c: In function 'main':
test.c:9: error: 'abstand' undeclared (first use in this function)
test.c:9: error: (Each undeclared identifier is reported only once
test.c:9: error: for each function it appears in.)
test.c:9: warning: implicit declaration of function 'Chirp'
test.c:10: warning: implicit declaration of function 'SerPrint'
test.c:11: warning: implicit declaration of function 'PrintInt'
test.c:38: error: expected declaration or statement at end of input
test.c:38: error: expected declaration or statement at end of input
make: *** [test.o] Error 1
> Process Exit Code: 2
> Time Taken: 00:01
2. Kann mir jemand sagen, wo man eine asuro ultraschall Bausatz kaufen kann, wo die Leiterplatte schon verdrahtet ist? Ich finde die Leiterplatte nur ohne die Verdrahtung..
Hallo.
Die Fehlermeldungen passen nicht zu dem Programm. Bitte noch mal überprüfen. Programm gespeichert vor dem Übersetzen?
Lesezeichen