krogk / AgroPi

Automated cultivation system for plants & mushrooms using Raspberry Pi
https://www.facebook.com/AgroPiOfficial
GNU General Public License v3.0
23 stars 11 forks source link

GPIO Driver & Relay Board Object #27

Closed krogk closed 3 years ago

krogk commented 3 years ago

Problem? Elego relay board is controlled by changing the state of the GPIO pins, currently there are no set of functions to do this,

Solution A GPIO driver object would be ideal, an instance of this object would be passed to the relay board object and the controller would controller hold both object and this object would be called in the sampler callback in actuator handler function.

Alternatives Alternativley the GPIO code could be contained within the relay board object, however if we need additional functionality for the GPIO such as PWM we would need to restructured the code then.

*Testing context** The testing should be focused on the relay board object, switching each relays on and off should be

In Addition a set of requirements needs to be created and the implementation should aim to achieve these requirements.

andrewsg3 commented 3 years ago

If we're pressed for time, wouldn't wiringpi do the trick?

krogk commented 3 years ago

Implemented in 78f01b468e57e9e33bd845090bab05f4cd63a354