Skip to content

Conversation

@soundanalogous
Copy link
Member

This is an evolution of #40 so I opened a new pull for it. I've added a pull request for the protocol as well: https://github.com/firmata/protocol/pull/8/files.

However adding this functionality is not so straight forward. There are 2 major issues:

  1. Only SAM-based variants include the methods analogReadResolution and analogWriteResolution.
  2. Only AVR-based variants support setting the analogReference value. SAM variants have an analogReference method, but it is set with a typedef value rather than a constant. Furthermore, the DEFAULT and EXTERNAL are defined for SAM variants, but they cannot be passed to analogReference since analogReference expects a parameter of type eAnalogReference which is a type created specifically for SAM variants.

There appears to be no clean implementation possible here. I'd have to pick an existing define that is unique to each architecture and use that to determine whether a board is of SAM or AVR architecture, or I'd have to add some defines to Boards.h to sort it out.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAM-based variants would need to skip this entire case.

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