#include Servo servo1; // Define servo1 Servo servo2; // Define servo2 Servo servo3; // Define servo3 int MotPin1 = 9; // connect motor1 to pin 9 int MotPin2 = 10; // connect motor2 to pin 10 void setup() { pinMode(MotPin1, OUTPUT); servo1.attach(3); // attaches the servo on pin 3 servo2.attach(5); // attaches the servo on pin 5 servo3.attach(6); // attaches the servo on pin 6 } void loop() { // Run Motor 1 for 0.3 second at half speed analogWrite(MotPin1, 150); delay(300); analogWrite(MotPin1, 0); // delay for random time 0.5 - 2 seconds delay(random(500,2000)); // Run Motor 2 for 0.5 second at half speed analogWrite(MotPin2, 150); delay(300); analogWrite(MotPin1, 0); // delay for random time 0.7 - 2,5 seconds delay(random(700,2500)); // Move the servos to new random positions servo1.write(random(60, 120)); delay(100); servo2.write(random(30, 90)); delay (150); servo3.write(random(30, 135)); delay(180); }