Skip to content

Friendly error message to catch and avoid ZeroDivisionError #29

Closed
@kevinjwalters

Description

@kevinjwalters

This library can end up throwing a ZeroDivisionError in

@property
def frequency(self):
"""The overall PWM frequency in Hertz."""
return self.reference_clock_speed / 4096 / self.prescale_reg
- this is probably occuring around issues with i2c communications but I'm not really sure. This is a confusing error especially for programmers not used to reading stack traces who may think it's a division problem in their code.

Users who have bumped into this (and reported it):

I'm finding some of the code in the PCA9685 class a bit puzzling but I'll put another issue in for that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions