Das Programm:
https://Mega.NZ/#! YFkyia5Q! x5ytSGWDa8olQ1eMkamRhZoXms2Irfb6kHHsMubzMGg
Der Code:
Int motorPin1 = 10;
Int motorPin2 = 11;
Int motorPin3 = 8;
Int motorPin4 = 9;
void setup()
{
Serial.Begin(9600);
PinMode (motorPin1, Ausgang);
PinMode (motorPin2, Ausgang);
PinMode (motorPin3, Ausgang);
PinMode (motorPin4, Ausgang);
DigitalWrite (motorPin1, 0);
DigitalWrite (motorPin2, 0);
DigitalWrite (motorPin3, 0);
DigitalWrite (motorPin4, 0);
}
void loop() {}
Char vDados = Serial.read();
Wenn (vDados == '1') {}
fFrente();
}
anderes
Wenn (vDados == "2") {}
fFrente();
fDireita();
}
anderes
Wenn (vDados == "3") {}
fDireita();
}
anderes
Wenn (vDados == "4") {}
fRe();
fDireita();
}
anderes
Wenn (vDados == '5') {}
fRe();
}
anderes
Wenn (vDados == '6') {}
fRe();
fEsquerda();
}
anderes
Wenn (vDados == '7') {}
fEsquerda();
}
anderes
Wenn (vDados == '8') {}
fFrente();
fEsquerda();
}
Delay(111);
fParar();
}
void fParar() {}
DigitalWrite (motorPin1, 0);
DigitalWrite (motorPin2, 0);
DigitalWrite (motorPin3, 0);
DigitalWrite (motorPin4, 0);
}
void fFrente() {}
DigitalWrite (motorPin1, 1);
}
void fDireita() {}
DigitalWrite (motorPin3, 1);
}
void fRe() {}
DigitalWrite (motorPin2, 1);
}
void fEsquerda() {}
DigitalWrite (motorPin4, 1);
}
https://www.Facebook.com/rafaelpollon
Entwickler:
Rafael Pollon - Elektrotechnik
Mauro Murari - Informations-System
Kelvin Salton - Informations-System