Asuro mit nem gamepad steuern??
Hallo
Kann mir jemand Helfen oder tipps geben ein Programm zu schreiben damit man einen Asuro mit nem gamepad steuern kann.
so kann ich den asuro mit der tastatur steuern
Code:
#include "asuro.h"
int main(void)
{
Init();
StatusLED(YELLOW);
char c[3]={0,0,0};
while(1)
{
SerRead(c,3,20);
if(c[1]=='w'||c[0]=='w')
{
StatusLED(YELLOW);
MotorDir(RWD,RWD);
MotorSpeed(100,110);
}
else if(c[1]=='s'||c[0]=='s')
{
StatusLED(YELLOW);
MotorDir(RWD,RWD);
MotorSpeed(180,0);
}
else if(c[1]=='a'||c[0]=='a')
{
StatusLED(YELLOW);
MotorDir(RWD,FWD);
MotorSpeed(0,140);
}
else if(c[1]=='d'||c[0]=='d')
{
StatusLED(YELLOW);
MotorDir(FWD,RWD);
MotorSpeed(150,0);
}
else
{
MotorSpeed(0,0);
StatusLED(GREEN);
}
c[0]=0;c[1]=0;c[2]=0;
Msleep(100);
}
return(0);
}
mfg