Skip to content

Miciomax added PWM support#66

Open
MicioMax wants to merge 3 commits intoOpenScan-org:developfrom
MicioMax:miciomax
Open

Miciomax added PWM support#66
MicioMax wants to merge 3 commits intoOpenScan-org:developfrom
MicioMax:miciomax

Conversation

@MicioMax
Copy link
Copy Markdown

@MicioMax MicioMax commented Mar 6, 2026

Added PWM support, both hardware and software.
For hardware support it needs this inside /boot/firmware/config.txt:
dtparam=audio=off
dtoverlay=pwm-2chan

I added a new class in utils (_HwPWM with the singleton hwpwm) in file pwm_hardware.py
It allows checkings of hardware pwm capabilities and settings.

gpio.py is modified to check if hardware pwm is available and, in case, use it.

A route is also added for lights:
@router.put("/{light_name}/intensity", response_model=LightStatusResponse)
value is from 0% to 100%. Frequency is preset in config file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants