Two questions, please.
First question is this: by looking at the code, how can I figure out which physical pin is referenced?
I have some code and a PCB containing at ATTiny84a QFN.
I want to mock it up on a breadboard using an ATTiny84a DIP.
The pins on both of those chips are laid out differently.
Here is the code:
#define PIN_A 0 #define PIN_B 2 #define PIN_C 3 #define PIN_D 1 #define PIN_EN 10 #define PIN_RAND 4 #define PIN_SWITCH 6 // AKA MOSI
Here are the pinouts
So, which physical pin on the DIP chip is PIN_A? Is it 2, is it 13, is it 5? (And pin 6 is not MOSI?!)
If the code says
const int buttonPin = 2; // the pin that the pushbutton is attached to const int ledPin = 13; // the pin that the LED is attached to
Was the code written for a specific chip, or does the pin get sorted out when the code is compiled?
If the pin in the blink sketch is 13, what happens if I use an ATTiny85 which only has 8 pins?
PS I don't know why I am having such a hard time grasping the concept of pins.