-
-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow analogPinToChannel for chips other than ATTinyX5 #1366
Comments
I would like this change as well. I makes it much easier to add new boards without needing to modify the core. @tarunpondicherry I can open up a pull request if you like? |
I also think this would be great as we've needed a more flexible way of mapping pins to analog channels for a while now. I would suggest that any pull request default to the current behavior if the analogPinToChannel() macro isn't defined. In addition, we'll probably want to test this on a range of boards. What do people have available to test with? I can try to cover some cases too. |
I can do test on a Arduino Mega 2560 if you provide the test. |
@niesteszeck you can find my test code here: #1368 (comment). |
This issue should be closed, as this was fixed with: #1368. |
For my board, it makes sense to renumber the pins on the ATTiny84. Thus, the ADC channel is no longer the same number as the Arduino pin number. The macro "analogPinToChannel" seems to address this, but it currently is only called for ATTinyX5 and ATMega32U4. I'm able to get my board working if I edit the arduino core (analogRead function) to ensure that the macro is called without restriction if defined. Could this macro be allowed to work for all chips without restriction if defined, instead of being restricted to only be called for ATTinyX5 and ATMega32U4? It would make it easier to use other chips without having to update the analogRead function each time.
The text was updated successfully, but these errors were encountered: