So after a ton of trying, troubleshooting, finding help from friends, I finally got a transistor connection to work and got two DC motors running together off of a code. One motor spins a sun and after it powers up the plants (a 6 second delay from a incremented counter), the flowers spin on the other motor.
here is the code:
int sunPin = 7; //sun motor pin
int flowerPin = 5; //flower motor pin
int ledPin = 13; //led runs as a check
int counter = 0; //counts how long program has been running</code>
void setup()
{
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
pinMode(sunPin, OUTPUT);
pinMode(flowerPin, OUTPUT);
}
void loop()
{
digitalWrite(sunPin, HIGH); //turns on sun immediately
if (counter == 6) //checks counter value
{
digitalWrite(flowerPin, HIGH); //if counter high enough, turns on led and flower
digitalWrite(ledPin, HIGH);
}
else
{
counter++; //if not long enough, counter is incremented
delay(1000); //1 second delay
}
}