ATtiny85 ADC Help

Please help..
i am currently trying to do a quick project that i can do on my uno, but want to make it on the attiny85 chip as a stand alone board.

using the uno i can analogueRead a analogue pin, from there i will map the reading to i can get a range from 1 sec to 10 sec from the potentiometer. all works fine and dandy.

now i have moved to a different chip and finally got the timmings set, sort of, as thats another issue, millis is not quite millis??

how can i read the pot so i can map it? the code compiles all ok the same as for the uno in the arduino ide, and it uploads all ok to the chip.

but my results are very irratic.

i have searched loads of forums and seen things like ADCSRA and so on, but they dont fully explain what they are doing, and now i have seen all these different words, will they work in arduino IDE?

many thanks in advance

Phil

What Arduino 'core' did you install so you can select something like "ATtiny 85" from Tool->Board:? I have "ATtinyCore" installed but it is a third-party core so I can't be sure you installed the same one.

The documentation for your installed core should tell you which pin names go with which physical pins. For example, the ATtinyCore uses:

1= 5 / A0     8= Vcc
2= 3 / A3     7= 2 / A1
3= 4 / A2     6= 1
4= Gnd        5= 0

Just seen that i had the one reply, and thankyou very much for taking the time.

i was wrecking my brain and going over more google searches this morning and finally got it sorted.
so i thought i would share what i found incase it helps someone else, little did i know on this chip you have to turn on the adc feature..

anyway look at this link for where i found my solution.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.