code for multiple peristaltic pumps DFR0523
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
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.
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
that_nathan_guy
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
2018-12-25 10:41:39 Yes, you can do that, and please choose the PWM pins like D3, D5, D6, D9
robert.chen
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)