-
Notifications
You must be signed in to change notification settings - Fork 78
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
Different AI resolution in python and node-red #407
Comments
After my investigation, node red set the ADC bit to 12bit, but I have a PR to resolve this one. |
As you correctly noted: That PR is a workaround, not the solution yet. |
And: there is no issue. node-red-node simply raises the number of bits to what the hardware can do. That is done at https://github.com/node-red/node-red-nodes/blob/9bae313b722147b00480ce2e26ed0aab357b836b/hardware/intel/mraa-gpio-ain.js#L15. That is logically one level above what the Python (or also NodeJS) bindings does which only exposes the AIO abstraction. And that abstraction chose to start with 10 bits, hardware-independently. IOW: Nothing to fix here or elsewhere, just to understand logic-wise. |
In that light, setting the number of bits unconditionally in node-red-node could even be questioned from a hardware abstraction POV. It should rather become a tunable of that node. |
Using the GPIO node-red node to read in an analog value from the I/O Module - either 0..10V or 0..20mA - results in a value from 0..4095 (12-bit resolution)
Using the same analog input with mraa in python the resolution is only 0..1023 (9-bit)
Where does this difference come from?
The text was updated successfully, but these errors were encountered: