I’m building a drink dispenser that controls 8 pumps via MOSFET’s. I want to be able to send the Spark core a command via WiFi (I presume with Spark.function), and trigger each “channel” depending on the command. Let’s say we have a drink that needs 4 cl from Pump1, 2 cl from Pump2, 10 cl from Pump 3 etc.
How would it be best to structure the command structure? Via multiple Spark.function calls, each per pump? If so, can I trigger each pump simultaneously via multiple calls? Does the Spark Core cue up Spark.function calls or can it handle it simultaneously. Because I want all pumps to activate simultaneously but end independently depending on incoming value.
How would you structure this and issue commands to the Spark Core to control it?
The facts of the project is:
8 Pumps controlled via MOSFET’s connected to the PWM pins (D0, D1, A0, A1, A4, A5, A6, A7)
I want to issue a/or multiple curl commands that trigger all the pumps to run for a set time. The time corresponds to a specific cl value. Basically I’m thinking of a syntax that says, PUMP0:10 where 10 equals 10 cl. But I want to be able to trigger them all so I don’t have to wait for each pump to finish before continuing to the next one.