Dvogonen / cyclop_plus_plus

Firmware upgrade for Quanum Cyclops FPV googles that adds support for manual channel selection, textual information on main screen and battery level alarm.
MIT License
20 stars 5 forks source link

[cyclops_plus_plus] - ensure that max alarm level doesn't exceed the … #12

Closed Memphiz closed 7 years ago

Memphiz commented 7 years ago

…maximum allowed dutycycle (255).

This fixes issue #8

1 << 8 is 256 - max allowed dutycycle is 255

the prototype of analogWrite is:

void analogWrite(uint8_t, int);

So it takes an signed int as dutrycycle parameter. Because of the int it doesn't rollover to 0 but to 1 maybe.

Dvogonen commented 7 years ago

Thank you for the fix