The current code utilises a while loop for sensing when a bottle/can has reached its full capacity, the problem with this is that it causes a block in the main program loop which is not ideal.
Using interrupts we can eliminate this while loop block in the main loop allowing for other critical functionality that relies on the main loop to execute flawlessly.
The problem we need to solve is that there's only two interrupt pins on the Uno and we require a lot more to monitor the three filling solenoids as well as a kill switch.
The solution would be to look at ways we can utilise a single pin and attach multiple interrupts and inputs on that pin.
This issue is only present with the Arduino Uno, the ESP8266 supports interrupts on all its digital pins.
The current code utilises a while loop for sensing when a bottle/can has reached its full capacity, the problem with this is that it causes a block in the main program loop which is not ideal.
Using interrupts we can eliminate this while loop block in the main loop allowing for other critical functionality that relies on the main loop to execute flawlessly.
The problem we need to solve is that there's only two interrupt pins on the Uno and we require a lot more to monitor the three filling solenoids as well as a kill switch.
The solution would be to look at ways we can utilise a single pin and attach multiple interrupts and inputs on that pin.
This issue is only present with the Arduino Uno, the ESP8266 supports interrupts on all its digital pins.