Hier testen wir mal, wie wir einen Arduino Code darstellen können:
int Motor1=5;
int Motor2=4;
int Motor3=3;
int delay1=2000;
void setup() {
pinMode(Motor1,OUTPUT);
pinMode(Motor2,OUTPUT);
pinMode(Motor3,OUTPUT);
digitalWrite(Motor1, HIGH);
digitalWrite(Motor2, LOW);
digitalWrite(Motor3, LOW);
}
void loop() {
delayMicroseconds(delay1);
digitalWrite(Motor2, HIGH);
delayMicroseconds(delay1);
digitalWrite(Motor1, LOW);
delayMicroseconds(delay1);
digitalWrite(Motor3, HIGH);
delayMicroseconds(delay1);
digitalWrite(Motor2, LOW);
delayMicroseconds(delay1);
digitalWrite(Motor1, HIGH);
delayMicroseconds(delay1);
digitalWrite(Motor3, LOW);
if (delay1>600) delay1=delay1-1;
}