-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
analogRead(A9) 255 #128
Comments
does it reproduce when PF3 is grounded (through a resistor, something in the 100-1000 range should be good)? If yes, do you confirm that ~0v is measured on the pin through an external device? The fact that 255 is the number makes me suspicious that a -1 might be getting treated as a signed byte somew2here along the line. A pin connected to nothing should never be used as a test of behavior except under very rare use cases - literally any value could be measured for it's voltage without violating any reasonable assumptions, providedd that value was between ground and the supply voltage. |
Thanks for reporting! I'm able to reproduce the issue. MegaCoreX/megaavr/cores/coreX-corefiles/wiring_analog.c Lines 54 to 59 in 358e102
The problem is that I'll fix it right away, but there won't be a new boards manager release just yet. There are some library improvements I'd like to finish first. Meanwhile, you can replace |
Hi Hans, perfect it works. Thanks so much for the quick fix. cheers |
Hi,
when i read the ADC value from Analog pin: A9 - (PF3 on a TQFP32 Atmega4808 pin23) i always get 255 even when nothing is connected.
If it is floating or put to ground always 255. All the other ADC pins working fine tested it on multiple cpus.
does someone have an idea ? I use the latest MegaCoreX 1.0.9 on Arduino.
cheers
Michael
The text was updated successfully, but these errors were encountered: