Analog to 8bit r2r DAC

PORTD=analogRead(A0)/4;