versuch es mal mit dem Quelltext, diesen habe ich geschrieben.
Der Asuro reagiert auf das Licht, macht sich also in einem etwas dunklem Raum und einer Taschenlampe.
einfach mal ausprobieren. ![Freudig](http://www.roboternetz.de/phpBB2/images/smiles/icon_biggrin.gif)
Achja, mein Asuro hat ein kleines Problem FWD ist bei dem RWD und umgekehrt....
Code:
#include "asuro.h"
int main(void)
{
unsigned int data[2];
unsigned char tastea;
unsigned char tasteb;
Init();
int i;
StatusLED(GREEN);
FrontLED(OFF);
MotorDir(RWD,RWD);
while(1)
{
tastea = PollSwitch();
Sleep(216);
tasteb = PollSwitch();
if (tastea == tasteb)
{
if (tasteb > 0)
{
MotorDir(FWD,FWD);
MotorSpeed(100,100);
StatusLED(RED);
for(i=0;i<=650;i++)
{
Sleep(216);
}
}
else
{
MotorDir(RWD,RWD);
LineData(data);
StatusLED(GREEN);
if(data[1] > data[0])
{
MotorSpeed(200,100);
BackLED(ON,OFF);
}
else
{
BackLED(OFF,ON);
MotorSpeed(100,200);
}
}
}
}
return 0;
}
Lesezeichen