Added INPUT_PULLUP support and let analog write use full PWM range

This commit is contained in:
ZodiusInfuser
2021-03-22 16:52:06 +00:00
parent f2a0e601b2
commit d0074840ab
7 changed files with 15 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ void analogWrite(uint32_t pin, uint32_t value)
ledc_channel_config_t ledc_conf = {
.channel = (pin % 7),
.duty = (value << 2),
.duty = (value << 2) | ((value & 0xC0) >> 6),
.gpio_num = pin,
.intr_type = LEDC_INTR_DISABLE,
.speed_mode = LEDC_HIGH_SPEED_MODE,