Referring to guide at High-low tech, I were able to flash ATTiny84 via UNO through Arduino IDE 1.6.7.
I loaded a simple blink LED program on IDE pin 0 (physical Attiny84 pin 13, PA0) and everything works fine for pin 0 till 7 at Port A.
But what if I want to access or blink a LED at one of the pins at Port B? Example, PB0 (physical pin 2)
The following is my current code to blink PA7
int led=7; //PA7
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(100);
digitalWrite(led,LOW);
delay(100);
}
2 Answers 2
According to the ATtiny web-page the pin/ports are numbered as below:
The physical pin 2 is the Arduino ATtiny core pin 10. You can also find this well documented in the pins_arduino.h file.
Cheers!
-
the picture is not what i looking for but the pins_arduino.h does help a lotDennis– Dennis2016年03月07日 07:30:49 +00:00Commented Mar 7, 2016 at 7:30
Refer to url link by @Mikael, this is the answer I'm looking for.
Arduino IDE & Pin Mapping
// ATMEL ATTINY84 / ARDUINO
//
// +-\/-+
// VCC 1| |14 GND
// (D 10) PB0 2| |13 AREF (D 0)
// (D 9) PB1 3| |12 PA1 (D 1)
// PB3 4| |11 PA2 (D 2)
// PWM INT0 (D 8) PB2 5| |10 PA3 (D 3)
// PWM (D 7) PA7 6| |9 PA4 (D 4)
// PWM (D 6) PA6 7| |8 PA5 (D 5) PWM
// +----+
IDE Attiny84 Physical Pin
0 PA0 13
1 PA1 12
2 PA2 11
3 PA3 10
4 PA4 9
5 PA5 8
6 PA6 7
7 PA7 6
8 PB2 5
9 PB1 3
10 PB0 2
In order to blink PB0, I would need to replace my code with int led=2; //PB0
-
Should it not be: int led=10; //PB0PimV– PimV2023年07月13日 10:30:15 +00:00Commented Jul 13, 2023 at 10:30