Hausaufgaben3 Lösung
/* Deklaration */
#include "AlphaBot.h" // Arduino Bibliothek einbinden
AlphaBot Alf = AlphaBot(); // Instanz des AphaBot wird erzeugt
const byte GESCHWINDIGKEIT_u8 = 90; // Geschw. wählbar: 0 - 255; Min: 80
void setup()
{
// Wird einmalig beim Start ausgeführt
Alf.SetSpeed(GESCHWINDIGKEIT_u8); // Geschw. setzen: 0 - 255
}
void loop()
{
// Wird zyklisch ausgeführt
for (int i=0; 4; i++) {
Alf.Forward(1000); // Geradeausfahrt
Alf.Brake(); // STOP
delay(1000); // Für 1 s
Alf.RightCircle(400); // AlphaBot dreht sich 90° nach rechts
Alf.Brake();
delay(1000); // Für 1 s
}
}
→ zurück zum Hauptartikel: Termin 3