So sieht das jetzige Programm aus:
Code:
#include "asuro.h"
int main(void){
int Lnow;
int Rnow;
int Rold;
int Lold;
int Count;
int sl;
int sr;
unsigned int data[2];
unsigned char taste;
	Init();
	while(1){
	Count=0;
	sl=120;
	sr=120;
	MotorDir(FWD,FWD);
	MotorSpeed(sr,sl);
	OdometrieData(data);
	if (data[0] > 412) Lnow = 1; else Lnow = 0;
    if (data[1] > 412) Rnow = 1; else Rnow = 0;
	if (Lnow ^ Lold) Count++;
	if (Rnow ^ Rold) Count--;
	Lold=Lnow;
	Rold=Rnow;
	if (Count>0) {sr++; BackLED(OFF,ON);}
	if (Count<0) {sr--; BackLED(ON,OFF);}
	if (sr>254){sr=255; sl--;}
	if (sr<61){sr=60; sl++;}
	}
	return 0;
}
So müsste es gehn. Wenn nicht, gebt hier eure Verbesserungsvorschläge.