Using all pins on Attiny 85

I need one analog input and four digital outputs. I had to address chip pin #3 as pin=2 to get it to use analog in. It would not let me delare pin=A4. How do I now use chip pin #7 which should be pin=2


//                  +-\/-+
// Ain0 (D 5) PB5  1|    |8  Vcc
// Ain3 (D 3) PB3  2|    |7  PB2 (D 2)  Ain1
// Ain2 (D 4) PB4  3|    |6  PB1 (D 1) pwm1
//            GND  4|    |5  PB0 (D 0) pwm0
//                  +----+

Looks like A1 to me.

the Attiny85 took PB2. Would not let ne by with A1.


I had the same need (4x digital and 1x analog) for a set of RC aircraft navigation lights based on ATtiny85. I used pin2 as the analog, and addressed it as 3. The definitions block follows:

const int wingTips = 0;                     // IC leg 5; red and green 3mm LED navigation lights for wingtips
const int LDRpower = 4;                     // IC leg 3; power for LDR, turned off if it's daylight
const int lightSensor = 3;                  // IC leg 2; LDR sensor reading
const int redBeacon = 1;                    // IC leg 6; flashing red 3mm LED on tail
const int headlight = 2;                    // IC leg 7; 2x 5mm white LEDs for landing lights

lightSensor in this sketch is a LDR, addressed using analogRead().

Hope that helps, Geoff

there is no port A on the 85, if you need to use analog use analogRead(1)

just like on the normal arduino, analog input 1 is actually digital pin 15 and avr port C1