ArduinoGeneral

code for multiple peristaltic pumps DFR0523

userHead that_nathan_guy 2018-12-25 08:04:08 1202 Views2 Replies
Hello,

I’m new to coding but am attempting to make use of a Bluno Mega to run three peristaltic pumps but I am unsure how to declare the three different pumps in the sketch.

Looking at the example given which utilizes the GravityPump.h library:


void setup()
{
pump.setPin(9);
button.init(2);
Serial.begin(115200);
pump.getFlowRateAndSpeed();
}

The pin for pump is declared by “pump.setPin()”. What is the proper syntax for using multiple pumps? Can I use:

void setup()
{
pumpA.setPin(4)
pumpB.setPin(5)
pumpC.setPin(6)

pumpA.getFlowRateAndSpeed()
pumpB.getFlowRateAndSpeed()
pumpC.getFlowRateAndSpeed()

}


Thanks for any help or direction you can give.
2018-12-25 11:32:44 Thanks for your response. I’m another step closer to finishing my project ???? userHeadPic that_nathan_guy
2018-12-25 10:41:39 Yes, you can do that, and please choose the PWM pins like D3, D5, D6, D9 userHeadPic robert.chen