Skip to content
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

Read PWM signal? #91

Open
jgoncalocouto opened this issue Mar 27, 2020 · 1 comment
Open

Read PWM signal? #91

jgoncalocouto opened this issue Mar 27, 2020 · 1 comment

Comments

@jgoncalocouto
Copy link

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"?

@myselfgautham
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants