Use more bits to store pin number. Enables servo support on A10-A15 on Arduino Mega. #11
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.
Servo.h currently uses 6 bits to store the pin number attached to a servo. On the Arduino Mega 2560 pins A10-A15 are mapped to 64-69. If a user attempts to attach a Servo object to these pins the 7th bit is truncated. This results pins A10-A15 (64-69) to be silently remapped to pins 0-5. The Servo library will then attempt to pulse pins 0-5 instead of 64-69.
The proposed solution is to use 7 bits to store the pin number instead of 6.