forked from zephyrproject-rtos/gsoc-2022-arduino-core
-
-
Notifications
You must be signed in to change notification settings - Fork 12
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 and analogReadResolution #36
Comments
I personally don't like it, but looks like A8-A11 are objects PureAnalogPin - which appears to be consistent with the MBED version. Hacked up sketch to allow it to run on those as well:
Checked on 8-11 and verified that they also return 0-4095 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
analogRead(A0) - is returning a value that does not fit within 10 bits, like 3349. Guessing that analogRead
is returning 12 bits, whereas the document:
https://docs.arduino.cc/language-reference/en/functions/analog-io/analogRead/
says that it should default to 10 bit resolution.
analogReadResolution(int bit) - is not defined within the system (i.e. compile error)
Target board + cli verbose compilation output
Arduino Zephyr - GIGA...
Optional: attach the sketch
Started with the AnalogInput.ino example sketch, with a few edits to use the built in LED and prints out the
values returned, if the value changed from the previous call.
Also checked for Serial input and used the input for which analog pin to use 0 is A0...
The above works for A0-A7
uncommenting A8-A11, gives compile errors.
Will look at later...
The text was updated successfully, but these errors were encountered: