I was after some sample code, to help me control the valve using a (Spark) Particle Photon. Just simply opening and closing it.
I already have a BrewPi working away as a fermenter. I also currently have code on a Photon controlling a relay and taking temperature reading’s from DS18B20’s. Next step is to control the motorized ball valve and I can do my own little ghetto brew controller. I know the BrewPi will eventually do all this, but I can’t wait, and would also like to tinker in the mean time.
If this has already been covered in another thread, please link me to that. Or even an external website.
So, as I’m a newby could I use https://build.particle.io to do this? Or is there a better environment to do this in?
I was thinking of importing the following into my project: #include #include “DS2408.h” #include “ActuatorInterfaces.h” #include “ControllerMixins.h” #include “ValveController.h”
I’m not sure, I haven’t tried that.
You can include the this file with empty mixins:
On the Spark we use a OneWire bus master IC and not do OneWire with bare microcontroller pins, for increased reliability. So it will not be a simple include and it works.
The DS2408 class takes a pointer to a OneWire class that provides the bus. You could provide one that implements pin OneWire.
You know you can add the OneWire board in the device manager for the BrewPi Spark, right? You can set it up as heater, cooler or manual actuator. If you set it up as manual actuator you get an open and close button in the device list.