MrYsLab / PyMata

A Python client class library for Interaction with Standard Firmata
GNU Affero General Public License v3.0
95 stars 40 forks source link

It it possible to change the baud rate? #34

Closed MortenGoertzJoensson closed 6 years ago

MortenGoertzJoensson commented 6 years ago

I need to output a 20hZ sinusoidal-like PWM signal from my Arduino. However I only get around 4hZ and I have a suspicion that I am limited by the baud rate of the connection.

Is it possible to set a different baud rate than the default one using PyMata? I tried looking through the documentation but could not find anything.

MrYsLab commented 6 years ago

PyMata simply sets the Arduino pin mode to PWM (set_pin_mode) and then sets the user's value (0-255) using analog_write on the Arduino. It is no different than if you wrote a sketch to do the same.

This article might help you achieve what you need to do: https://www.arduino.cc/en/Tutorial/SecretsOfArduinoPWM

I am assuming you are trying to create the signal on an Arduino pin and not send a 20 hz signal over the USB serial port.

MrYsLab commented 6 years ago

I am going to close this issue. If you have any other questions, you may add them to this thread and I will see them.