Is there a way to change arduino analog reference to EXTERNAL IN PYTHON using pyfirmata or any other library ? Necessary Links : https://www.arduino.cc/reference/en/language/functions/analog-io/analogreference/
My sensor has a 3.3 volt operating voltage , my arduino has a 5 volt operating voltage. As such in arduino using C++ and arduino module the scaling can be done using analogReference(External) and providing reference voltage to analog read?
IS there any equivalent to this in python, pyfirmata ?
1 Answer 1
No, not as far as I know. The firmata protocol does not include a command to set the analog reference. However, you can of course modify the firmata firmware to your liking. In the simplest case, just add the appropriate command to the setup()
function of the main .ino.
-
I have been using pyfirmata for the previous projects. Since pyfirmata doesnt include the necessary function , you suggest adding analogreference(External) to the firmata module that i would have to upload and run on arduino , would that make the analog reference voltage external when accessing with pyfirmata and python?Shahan hasan– Shahan hasan2021年05月03日 20:24:59 +00:00Commented May 3, 2021 at 20:24
-
1@Shahanhasan Yes. Firmata doesn't use
analogReference()
anywhere in the code, so when you addanalogReference(EXTERNAL)
to the startup code, it should change the behavior when accessing it from pyfirmata.PMF– PMF2021年05月04日 05:03:50 +00:00Commented May 4, 2021 at 5:03
Explore related questions
See similar questions with these tags.