Hey everyone!
I’m completely new to coding and I am in dire need of some professional assistance! 8)
I am trying to code an Arduino to control 2 mini 12V water pumps. I am trying to code it so the first pump will go for 5 seconds then stop, when the second pump will start and go for 5 seconds then stop and continues on a loop.
I’ve been trying to manipulate this code, but to no avail:
int motorPin = 3;
void setup()
{
pinMode(motorPin, OUTPUT);
Serial.begin(9600);
while (! Serial);
Serial.println(“Speed 0 to 255”);
}
void loop()
{
if (Serial.available())
{
int speed = Serial.parseInt();
if (speed >= 0 && speed <= 255)
{
analogWrite(motorPin, speed);
}
}
}
The details to the 2 pumps:
• Rated Voltage: 12V
• Working Voltage: 6-15V (Maximum 18V)
• Rated Current: 1.2A
• Maximum Lift: 5M
• Maximum Flow Rate: 840L/Hour
• Use it on 6V-15V, otherwise the Water Pump will be burning-out
Can anyone please please help me?