Moin,
ich hab ein Programm geschrieben weiß aber nicht ob das richtig ist und wollte nachfragen ob das ok ist?
Dann noch eine Frage, kann ich das makefile aus dem Beispiel von der Cd nehmen, damit ich die hex.Datei bekomme oder brauche ich ein anderes makefile, wenn ja welches?

Programm:

#include "asuro.h"
#define FULL_L 250
#define FULL_R 220
void MotorFwd(void)
{
MotorDir(FWD,FWD);
MotorSpeed(FULL_L,FULL_R);
}
void MotorRwd(void)
{
MotorDir(RWD,RWD);
MotorSpeed(FULL_L,FULL_R);
}
void MotorRwdL(void)
{
MotorDir(RWD,RWD);
MotorSpeed(FULL_L,0);
}
void MotorRwdR(void)
{
MotorDir(RWD,RWD);
MotorSpeed(0, FULL_R);
}
void MotorStop(void)
{
MotorSpeed(0,0);
}

int main(void)
{
unsigned char t1, t2;

Init();
while(1)
{
t1 = PollSwitch();
t2 = PollSwitch();
if(t1 == 0 && t2 == 0)
{
MotorFwd();
FrontLED(ON);
BackLED(OFF,OFF);
}
else if (t1 && t2 && t1 == t2)
{
MotorStop();
if(t1 & 0x07)
{
MotorRwdL();
FrontLED(OFF);
BackLED(ON,OFF);
}
if (t1 & 0x3
{
MotorRwdR();
FrontLED(OFF);
BackLED(OFF,ON);
}
Msleep(1000);
}
}
return 0;
}