PCA9685 (driver15) - Allow the "ALL" virtual pin 61 for pwm values

The datasheet shows register 250 is "ALL" pins, which corresponds to
virtual pin 61 (61*4+6=250).  Pin 61 was already allowed with PWM
command for OFF and ON, but not specified pwm values.  This update
allows virtual pin 61 to be assigned pwm values for all channels.

Example usage to set all channels to 2500:

`driver15 pwm,61,2500`
This commit is contained in:
Scott 2022-01-23 13:14:19 -05:00
parent 2cd510beb9
commit fd550fd104
1 changed files with 1 additions and 1 deletions

View File

@ -181,7 +181,7 @@ bool PCA9685_Command(void)
return serviced; return serviced;
} }
uint16_t pwm = atoi(ArgV(argument, 3)); uint16_t pwm = atoi(ArgV(argument, 3));
if ((pin >= 0 && pin <= 15) && (pwm >= 0 && pwm <= 4096)) { if ((pin >= 0 && pin <= 15 || pin==61) && (pwm >= 0 && pwm <= 4096)) {
PCA9685_SetPWM(pin, pwm, pca9685_inverted); PCA9685_SetPWM(pin, pwm, pca9685_inverted);
Response_P(PSTR("{\"PCA9685\":{\"PIN\":%i,\"PWM\":%i}}"),pin,pwm); Response_P(PSTR("{\"PCA9685\":{\"PIN\":%i,\"PWM\":%i}}"),pin,pwm);
serviced = true; serviced = true;