Closed Vido closed 9 years ago
Are you asking how to determine if a pin is PWM or not from the capability report or if PyMata prevents an application from setting a non-PWM pin as PWM?
If you are asking how to do determine if a pin supports PWM from the capability report, PWM is indicated with a value of 3 in the list returned for the pin.
If it is the latter, PyMata does not prevent a user from picking a non supported pin mode for the pin, since that is not part of the Firmata protocol. The application should qualify the pin mode selection for validity. s2a_fm https://github.com/MrYsLab/s2a_fm, a program that utilizes the PyMata library does that when a user sets a pin mode. You can look at https://github.com/MrYsLab/s2a_fm/blob/master/scratch_command_handlers.py to see how it checks for pin mode validity.
Firmata protocol tells you which pin has PWM. https://github.com/firmata/protocol/blob/master/protocol.md#capability-query
How does PyMate separate Digital Only from PWM?