MCUdude / MicroCore

A light-weight Arduino hardware package for ATtiny13

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A2 doesn't match pin when INPUT_PULLUP

lunaoe opened this issue · comments

pinMode(A2, INPUT_PULLUP); doesn't work.

  1. Why can't the definitions be changed in pins_arduino.h?
  2. Does this mean the pinout diagram is wrong?
commented

You can only use analog pin definitions when using analogRead. Use pinMode(4, INPUT_PULLUP); instead

commented

The reason why is because analog and digital pins doesn't line up, so a compromise has to be made.

I'm using an enum to refer to analog pins. I'm doing this because it throws an error if you don't use an analog pin definition (for instance A2) with analogRead. There is nothing wrong with the pinout