|
Why a PWM value should NEVER be 255...
This is also why you should always limit your PWM values to 254 -- NEVER allow them to be 255.
If you look at the output order, there is always a PWM value output between things that could possibly be a value of 255 (for instance you may want all relays ON, in this case relayA may be all 1's which is $FF or 255. If this was next to another thing, say relayB that could also be 255, the master CPU would think, "A HA, This is the start of the data stream" But, Innovation First cleverly put a PWM value in between RelayA and RelayB. So, the only way to make a "255, 255" sequience is to foolishly allow the PWM value to equal 255.
This problem can cause very subtle errors. MOST of the time everything is right as rain, then BOOM! Thunder and lighting! your code crashes.
Do yourself a favor, make sure you get good at limiting the values of your PWM outputs to 0-254.
Joe J.
|