hello,
i am attempting to use an attiny85 to read incoming voltage, and based on that voltage reading, write out a pwm value. having some big problems. i’m using the arduino ide with the Arduino-Tiny core. i can program the attiny with (seemingly) no problem. now using this circuit-
http://s13.postimg.org/3sb7lbu3b/grady_ … _v3_bb.jpg
here is the code:
// to run on attiny85
const byte pwmPin = 0;
const byte analogInPin = A2;
void setup() {
pinMode(pwmPin, OUTPUT);
}
void loop() {
int analogIn = analogRead(analogInPin);
analogWrite(pwmPin, analogIn);
}
should be simple- i should get a reading from the arduino micro analogin of around 790- which should equate to 3.86 volts. but instead i get 1023- the value of the full 5v.
any thoughts? thanks in advance!