Skip to content

Setting LED current #1

Closed
Closed
@DaveLangstaff

Description

@DaveLangstaff

Setting the LED current to 0, with sensor.led_current=0 gives the unexpected result of actually setting the current to the maximum value possible, due to wrap around in the calculation.

Suggest modifying line 620 of file to:

    new_current = max(0, min(127,int((led_curent - 4) / 1)))

to coerce current being set to valid range.

regards
dave Langstaff

Metadata

Metadata

Assignees

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