PiBrewing / craftbeerpi4

GNU General Public License v3.0
57 stars 29 forks source link

Update GPIOActor __init__.py #126

Closed jabib closed 6 months ago

jabib commented 7 months ago

Adds an option for an Inverted PWM GPIO control. I have a Common Anode RGB LED connected to my Pi which I would like to control with software PWM. This requires an inverted pin scheme. I copied the GPIOPWMActor and modified all locations where the duty cycle is being applied, which should keep the UI consistent with selecting the Power % based on the on-state.

Edit: I have never contributed in GitHub before, so if I botched this, please let me know!

avollkopf commented 7 months ago

I will look into it, but need some time. PRs need to go first into the dev branch for testing and can later be merged into the master branch.

jabib commented 7 months ago

Sounds good. I did comment the few lines I did change from the original GPIOPWMActor class (Lines 181, 200, 208, 213, 236) with the exception of 163 where I didn't comment the naming of the class

avollkopf commented 6 months ago

I have released a new version (4.3.2) and will now look into this change. Most likely, I will just add an option 'inverted' to the pwm actor. In this case, there is no need for another actor

avollkopf commented 6 months ago

Version 4.3.3.a1 should be working. I have not added the extra actor bat added a parameter to the existing gpiopwm actor to enable inverted pwm load cycle. Please report back, if it is working for you

jabib commented 6 months ago

Updated last night (first time updating) and need to set all my actors again, but seems like everything's in order and working as intended. Thank you!