I use a attiny24A
At the moment I read the ADC of PA2 and than do an action if the signal is below 125 decimal.
My problem is that when the attiny is working in a eviroment of 70 degrees it is just triggering the signal like it was below 125 decimal
I did a lot of measurements on the incoming signals and the supply voltage, but the incoming signals dont drop and are clean and there are no dips in the supply voltage.
I even connect PA2 with a resistor to 5Volt and 1uF to ground, and still the pin is triggered.
I get a bit confused.
Now I was thinking maybe I can read the ADCH 5 times and take the average of this, but I don't know how to do this?
Can any one give me some help.
I include a piece of the code