int motorPin = 10; // PWM pin to control the motor int onTime = 3000; // duration in milliseconds of the motor on time (3 seconds) int offTime = 3000; // duration in milliseconds of the motor off time (3 seconds) void setup() { pinMode(motorPin, OUTPUT); // set the motor control pin as an output } void loop() { analogWrite(motorPin, 255); // turn on the motor at maximum speed (255 is the maximum value) delay(onTime); // wait for 3 seconds analogWrite(motorPin, 0); // stop the motor (PWM value of 0) delay(offTime); // wait for 3 seconds before restarting the cycle }