erropix / ESP32_AnalogWrite

Provides an analogWrite polyfill for ESP32 using the LEDC functions
MIT License
161 stars 36 forks source link

Not working #15

Open De-Jeriyo opened 4 months ago

De-Jeriyo commented 4 months ago

The example code gives me this error "c:\Users\User\Documents\Arduino\libraries\ESP32_AnalogWrite\analogWrite.cpp: In function 'int analogWriteChannel(uint8_t)': c:\Users\User\Documents\Arduino\libraries\ESP32_AnalogWrite\analogWrite.cpp:44:9: error: 'ledcSetup' was not declared in this scope 44 | ledcSetup(channel, _analog_write_channels[i].frequency, _analog_write_channels[i].resolution); | ^~~~~ c:\Users\User\Documents\Arduino\libraries\ESP32_AnalogWrite\analogWrite.cpp:45:9: error: 'ledcAttachPin' was not declared in this scope; did you mean 'ledcAttach'? 45 | ledcAttachPin(pin, channel); | ^~~~~ | ledcAttach"

dee1337 commented 2 months ago

fixed it in https://github.com/erropix/ESP32_AnalogWrite/pull/16/commits/3e0fb55129932853f87962ea11a1dbbbc8b79694

codemasters1 commented 3 weeks ago

OLD ver ledcSetup(PWM_CHANNEL, PWM_FREQUENCY, PWM_RESOLUTION); ledcAttachPin(BUZZER_PIN, PWM_CHANNEL);

NEW ver ledcAttach(BUZZER_PIN, PWM_FREQUENCY, PWM_RESOLUTION);