const int motorPin = 9; // Digital pin connected to the transistor base (via a resistor)
void setup() {
pinMode(motorPin, OUTPUT); // Set the motorPin as output
}
void loop() {
digitalWrite(motorPin, HIGH); // Turn the motor ON
delay(1000); // Wait for 1 second
digitalWrite(motorPin, LOW); // Turn the motor OFF
delay(1000); // Wait for 1 second
}