pyFirmata
pyFirmata copied to clipboard
Read PWM signal?
Hello,
I'm very green on arduino, I just know the very basics. Because python is more easy for me I started using pyfirmata to control arduino.
Having that said, it can be my incompetence, but I've search everywhere and couldn't find an answer. I would like to measure frequency with the arduino, in order to get feedback of the rotational speed from a fan. I'm just clueless on how to do it with pyfirmata. I thought it could be done by setting a digital pin to pwm mode and then perform a read operation but it doesn't work. Also, I tried to just read digital input with very small time steps and then calculate the duty cycle over a larger period of time by counting the ones and the zeros, but also no good results.
Is there a way to do this with pyfirmata or should I just learn the "arduino language"?
Bro You Cant Read A PWM Signal
But There Is A Similar Thing To It Called Analog Signals
Analog Signal Have 6 Pins I Believe On The Arduino (A0 A1 A2 ETC)
- Connect The Signal To One Of The Analog Ports
- Change PINDEF To a For Analog Or Use board.analog[*].enable_reporting()
- Then Read The Input