Hello, I have a few beginner questions hopefully yall can help me with. I need to program my arduino to delay 45 seconds before sending power to the motor. I have it programmed and wired now so that it turns the motor on as soon as I plug in the 9V battery. I've included pictures and a copy of the code I'm using now to help clarify what's going on. If anybody could help me with the programming I'd appreciate it. Thanks!
const int motorPin = 3;
const int buttonPin = 8;
int buttonState = LOW;
I appreciate the response. Wasn't really sure where to go from there. This is my first time using Arduino. After a lot of research I've found a tutorial about how to delay an LED. Using pin 13 and GND i can program the LED to turn on and off when I want it to. I thought that plugging the motor into those pins would work, however I've realized I will need to use either a Relay or a transistor/resistor combo. I've tried using the transistor and resistor on a breadboard to no avail. How would I use a 9v relay to make this work?
int led = 13;
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
After a lot of research I've found a tutorial about how to delay an LED.
A lot of research? That example is supplied with the IDE, along with a lot of others. It's not even a very good example, since it teaches bad habits. The blink without delay example is far better.