Hallo,
willkommen im RN-Forum.
Ich kann dein Programm nicht fehlerfrei kompilieren, diese Version ist (syntax-)fehlerfrei:
Code:
#include "asuro.h"
int main(void)
{
unsigned int data[2];
int a;
char input[1];
Init();
FrontLED(ON);
MotorDir(FWD,FWD);
while(1)
{
SerRead(input,1,0);
if(input[0]=='a')
{
a = 120;
}
else if(input[0]=='b')
{
a = 180;
}
else if(input[0]=='c')
{
a = 200;
}
else if(input[0]=='d')
{
a = 220;
}
else
{
a = 250;
}
LineData(data);
if(data[0]>data[1])
{
MotorSpeed(a,0);
BackLED(ON,OFF);
}
else if (data [0] < data [1] )
{
MotorSpeed(0,a);
BackLED(OFF,ON);
}
else
{
MotorSpeed(a,a);
BackLED(ON,ON);
}
}
return(0);
}
Allerdings kann ich es im Moment nicht testen. "if else" kennt C nicht, int i ist a und die Lib wird mit #include "asuro.h" eingebunden.
Ich hoffe das hilft
mic
Lesezeichen