die status led blinkt hektisch gelb
Das ist schlecht, denn diese soll im 1-Sekunden-Takt rot und grün blinken. OK, dann müssen wir Segel um Segel hochziehen, bis Dein ASURO soweit ist. Wir checken zunächst Dein Ultraschallortungssystem:
Code:
#include "asuro.h"
int abstand=0;

int main(void)
{
  Init();
  SerWrite("\r\n  --- ultrasonic test ---",29);
  Msleep(1000);
  
  do
  {
    abstand=Chirp();
    SerWrite("\r\n distanz in cm: ",20);
    Msleep(500);
    PrintInt(abstand);
  }
  while(1);
  return 0;
}
Probiere mal, welche Werte bei Dir ankommen, und justiere Dein System so, dass die angegebenen Werte der Realität entsprechen. Vielleicht musst Du auch noch an dem 1MOhm-Trimmer des RC-Gliedes drehen. Bei mir steht der Widerstand etwa in der Mitte.

Dann vielleicht das hier:

Code:
#include "asuro.h"
#define MAXDIFF 90

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(YELLOW);
	  MotorDir(FWD, FWD);
	  MotorSpeed(150, 100);
	  Msleep(10);
	}
	else
	{
	  StatusLED(RED);
	  MotorDir(RWD, RWD);
	  MotorSpeed(150, 100);
	  Msleep(10);
	}
	
	if (zaehler > 800)
	{
		StatusLED(RED);
		BackLED(ON,ON);
	    MotorDir(RWD, RWD);
	    MotorSpeed(200, 250);
	    Msleep(10);
		BackLED(OFF,OFF);
	}
	if (zaehler > 810)
	{
		StatusLED(RED);
		BackLED(ON,ON);
	    MotorDir(RWD, RWD);
	    MotorSpeed(250, 200);
	    Msleep(10);
		BackLED(OFF,OFF);
				
		if(zaehler > 820)
		  zaehler = 0;
	}
  }
  return 0;
}
[/code]