Pin names on the ATtiny85

I'm going to write a small program for a 'tiny85 that will have 2 digital inputs and one digital outputs. Now looking at the reference page on the "high low tech" website they give each pin a number name (like "Pin 2") but they are also analog inputs with different numbers for example physical pin 7 is called "Pin 2" and "Analog input 1" so am I doing a digital read/write on pin 2 and changing that for analogread(1) if I'm using it as an analog input ?

they give each pin a number name (like "Pin 2") but they are also analog inputs with different numbers for example physical pin 7 is called "Pin 2" and "Analog input 1" so am I doing a digital read/write on pin 2 and changing that for analogread(1) if I'm using it as an analog input ?

Yes.
There are hundreds of ATtiny Arduino articles all over the Internet like this one:

If you are having to ask the question about uC pin usage, you have not read enough and are heading for a most frustrating experience (or we forum members are headed for a frustrating experience trying to support you in this endeavor.)
Read: (short topics)

http://arduino.cc/en/Tutorial/AnalogInputPins

Generally, if using a standard Arduino such as a UNO, the sample programs will give you an overview of all of the different commands which cover the mix-use of physical pins.
Other great tutorials are:
http://learn.adafruit.com/category/learn-arduino

And if you prefer, watch some great videos on YouTube:

There is absolutely NO SUBSTITUTE for learning by doing, but I generally recommend that for fundamental knowledge (you know- the foundation material), that you take a more worn path with Arduino rather then the ATtiny85 which IS NOT truly 100% Arduino compatible, although folks such as Coding Badly's work on the tiny core is nothing short than phenomenal.

Ray

ATtiny+44-45-84-85+pin+details.png

Well you have successfully provided me with a lot of information or links to it without answering the question at all !, and my question was part of your fundamentals.....

sparkylabs:
Well you have successfully provided me with a lot of information or links to it without answering the question at all !, and my question was part of your fundamentals.....

a) The pin mapping will depend on the 'core' you installed, which you didn't tell us.

b) You could figure it out in two minutes by fiddling with the blink sketch and touching pins with a LED.

err, i mentioned the high-low tec website which is where the image posted previously comes from i beleive.

the video tutorials are pretty good, although I still find it baffling that people think they can learn micro's before understanding electronics fundamentals which explains alot of the confused people in the electronics section and some of the sorts of questions I get asked by people buying parts from me.

sparkylabs:
err, i mentioned the high-low tec website which is where the image posted previously comes from i beleive.

I just typed "high low tech" (or should it be "high-low tec"?) into google and came up with this: http://hlt.media.mit.edu/

Nothing about Tiny85 cores on there.

Normally people would be able to say something like "I installed this: Google Code Archive - Long-term storage for Google Code Project Hosting. ... "

so am I doing a digital read/write on pin 2 and changing that for analogread(1) if I'm using it as an analog input ?

I really need to learn to have my first cup of coffee before posting responses. My bad....

so am I doing a digital read/write on pin 2 and changing that for analogread(1) if I'm using it as an analog input ?

I have used that core before but I believe that Google Code Archive - Long-term storage for Google Code Project Hosting. is superior, but that is another discussion since you specifically asked about the MIT core. The answer is in the file pins_arduino.h which is part of any core that deviates from the standard boards installed with the Arduino GUI.
To summarize, Physical pins are mapped to virtual pins by function based on valid capabilities of the uC. For pins that are identified as "analog", they can generally be digital I/O too but only if the pin mapping provides for such... in the case of the MIT core, the definitions do - but you, the programmer must select "analog" or "digital" and for the latter you must specify input or output state. You can switch modes during a running sketch but generally the external-to-chip wiring would preclude such althoug with clever design you can often get away with such magic - for example, you could have an RC network feeding an analog input and then switch to digital at some value and use the digital 'low' value to discharge the capacitor... or, conversely you could use the digital 'hi' value to charge the capacitor and switch to analog to monitor the capacitor discharge much like a 555. Extreme care must be exercised in such mixed-use scenarios because of source/drain limitations on the digital I/O.

Ray

/*
  pins_arduino.c - pin definitions for the Arduino board
  Part of Arduino / Wiring Lite

  Copyright (c) 2005 David A. Mellis

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA

  $Id: pins_arduino.c 565 2009-03-25 10:50:00Z dmellis $

  Modified 28-08-2009 for attiny84 R.Wiersma
  Modified 09-10-2009 for attiny45 A.Saporetti
*/

#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <avr/pgmspace.h>

// ATMEL ATTINY45 / ARDUINO
//
//                  +-\/-+
// 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
//                  +----+

#define digitalPinToPCICR(p)    ( ((p) >= 0 && (p) <= 4) ? (&GIMSK) : ((uint8_t *)0) )
#define digitalPinToPCICRbit(p) ( PCIE )
#define digitalPinToPCMSK(p)    ( ((p) <= 4) ? (&PCMSK) : ((uint8_t *)0) )
#define digitalPinToPCMSKbit(p) ( (p) )

#ifdef ARDUINO_MAIN

// these arrays map port names (e.g. port B) to the
// appropriate addresses for various functions (e.g. reading
// and writing) tiny45 only port B 
const uint16_t PROGMEM port_to_mode_PGM[] = {
	NOT_A_PORT,
	NOT_A_PORT,
	(uint16_t) &DDRB,
};

const uint16_t PROGMEM port_to_output_PGM[] = {
	NOT_A_PORT,
	NOT_A_PORT,
	(uint16_t) &PORTB,
};

const uint16_t PROGMEM port_to_input_PGM[] = {
	NOT_A_PIN,
	NOT_A_PIN,
	(uint16_t) &PINB,
};

const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
	PB, /* 0 */
	PB,
	PB,
	PB,
	PB, 
	PB, // 5

};

const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
	_BV(0), /* 0, port B */
	_BV(1),
	_BV(2),
	_BV(3), /* 3 port B */
	_BV(4),
	_BV(5),

};

const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
	TIMER0A, /* OC0A */
	TIMER0B,
	NOT_ON_TIMER,
	NOT_ON_TIMER,
	NOT_ON_TIMER,
	NOT_ON_TIMER,
};

#endif

#endif