Und gleich noch eine Frage:
ich habe gerade versucht mit der Lib 2.71 den US-Code der Homepage von Dr.Henkes (ich hoffe er hat nichts dagegen) zu kompilieren:
Code:
/*
Bewegung auf Basis Ultraschallortung
Dr. Erhard Henkes, Mai 2007
*/
#include "asuro.h" // incl. der Funktionen InitUltrasonics, RestoreAsuro, Chirp von "dopez" (roboternetz)
#define MAXDIFF 80 // Sehr große Sprünge zunächst ausblenden
int main(void)
{
int abstand, abstand_alt, diff, zaehler=0;
Init();
abstand = Chirp();
while(TRUE)
{
abstand_alt = abstand;
abstand = Chirp();
++zaehler;
diff = abstand - abstand_alt;
if( (abstand>15) && (abs(diff)<MAXDIFF) )
{
StatusLED(GREEN);
MotorDir(FWD, FWD);
MotorSpeed(150, 150);
}
else if( (abstand>10) && (abstand<=15) && (abs(diff)<MAXDIFF) )
{
StatusLED(GREEN);
MotorDir(FWD, FWD);
MotorSpeed(100, 150);
Msleep(30);
}
else
{
StatusLED(RED);
MotorDir(RWD, RWD);
MotorSpeed(150, 100);
Msleep(100);
}
if (zaehler > 400)
{
StatusLED(RED);
BackLED(ON,ON);
MotorDir(RWD, RWD);
MotorSpeed(200, 250);
Msleep(10);
BackLED(OFF,OFF);
}
if (zaehler > 405)
{
StatusLED(RED);
BackLED(ON,ON);
MotorDir(RWD, RWD);
MotorSpeed(250, 200);
Msleep(10);
BackLED(OFF,OFF);
if(zaehler > 410)
zaehler = 0;
}
}
return 0;
}
und kriege folgende Fehler:
C:\ASURO_SRC\asurolib\examples\FirstTry/test.c:12: undefined reference to `Chirp'
C:\ASURO_SRC\asurolib\examples\FirstTry/test.c:17: undefined reference to `Chirp'
Kann mir bitte jemand sagen wo ich den "Chirp" herkriege bzw. wo ich ihn einbinden muss?
Lesezeichen