attiny85 and arduino - analogRead + pwmOut
Analog read is 10-bits (2^10 = 0-1023 range), analog write is 8-bits (2^8 = 0-255 range). Ditch the lower two bits of the result either by doing: 

analogIn = analogIn &gt;&gt; 2;


which can be shortened to:

analogIn &gt;&gt;= 2;


Or you can use the rather complex map function:

analogIn = map( analogIn(0, 1023, 0, 255) )