You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow analogPinToChannel for chips other than ATTinyX5 #1366
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.
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.
Activity
Lauszus commentedon Apr 16, 2013
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?
damellis commentedon Apr 17, 2013
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.
niesteszeck commentedon Apr 17, 2013
I can do test on a Arduino Mega 2560 if you provide the test.
Lauszus commentedon Apr 17, 2013
@damellis I can test it on Arduino Mega, Mega 2560, Uno and Leonardo. I have just send a pull request that should fix this: #1368.
Lauszus commentedon Apr 19, 2013
@niesteszeck you can find my test code here: #1368 (comment).
Lauszus commentedon Feb 20, 2014
This issue should be closed, as this was fixed with: #1368.