Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lights: fix value2pwm range conversion #1905

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Sep 10, 2019

#1902 (comment)

Sending HSV commands works perfectly though, as does the HSV returned on mqtt, but again no physical output from device.

  • revert toPWM type change, value could not fit values larger than 255
  • try1 in handling map() output types

however, arduino map() is technically not entirely correct
https://github.com/PaulStoffregen/cores/blob/238b102ac46d1184e7055943cb5fe60bcb8eabbe/teensy4/wiring.h#L47
https://github.com/arduino/Arduino/issues/2466#issuecomment-69873889
https://forum.pjrc.com/threads/44503-map()-function-improvements
as I have not tried it with floating point inputs, it is likely broken

@mcspr mcspr merged commit cf3bd49 into xoseperez:dev Sep 10, 2019
@mcspr mcspr deleted the lights/value-overflow branch September 10, 2019 16:09
@CrazyIvan359
Copy link
Contributor

Oh Paul, always fixing Arduino libraries lol.

I'll let you know how it goes when I have a chance to test.

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