Skip to content

setPWM() tests channel number incorrectly #27

@twrackers

Description

@twrackers

In method setPWM(...), the channel number is tested incorrectly.

The method currently reads

void Adafruit_TLC59711::setPWM(uint16_t chan, uint16_t pwm) {
if (chan > 12 * numdrivers)
return;
pwmbuffer[chan] = pwm;
}

Assuming the channel numbers count up from zero, the inequality should read

if (chan >= 12 * numdrivers)

so that for, say, numdrivers=1, chan should be accepted for the range 0 to 11, not 0 to 12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions