Prevent unexpected execution of commands #12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are some undocumented "commands" from 2100-2200 us that allow for control of the Blinkin beyond just changing the pattern. Some of the commands can do include disabling the LEDs and changing strips, but they have a problem. To trigger a command only one pulse of the correct length is required. This means that an extraneous pulse can cause the Blinkin to do random things and such as turning off the strip. On my robot I have noticed this happening at least once and sometimes as often as five times in an hour. A forum post describing the issue can be found here. I made a
sample Arduino sketch to demonstrate the issue.
This was already fixed for changing patterns as they require 3 pulses of the same length to trigger, so I implemented the same system for commands.
See PWM_0_Command.ino for the current implementation of of the commands and interrupt.ino for where they get called.