I can't seem to get my very first motor to work. This is the first code that I wrote from scratch:
// Moter control 01
// burst the motor a few times and loop
#define MOTOR 9 // the pin for the motor
void setup() {
pinMode(MOTOR, OUTPUT); // the pin for the motor
// is an output
}
void loop() {
digitalWrite(MOTOR, HIGH); // turn the motor on
delay(1000); // waits for a second
digitalWrite(MOTOR, LOW); // turns the motor on
delay(600); // waits for some time
}
would it work if I have the circuit put together correctly? If so, what is the correct circuit, because I can't understand The diagram that's in the book.