runger1101001 / Arduino-FOC-dcmotor

MIT License
4 stars 13 forks source link

simple dc_open_loop example not working with esp32 and L296n #5

Open disc0018 opened 1 year ago

disc0018 commented 1 year ago

I tried to use I simple esp32 and L296n. I was not able to get a working PWM signal. I changed the DCDriver to DCDriver1PWM2Dir driver = DCDriver1PWM2Dir(14, 2, 27); (Hardwareconfig was ok. I simple ledcWrite(ledChannel, dutyCycle) was working for test.)

It seems like the following hardware specific code in esp32_ledc_mcu.cpp is never reached: ......

void _writeDutyCycle1PWM(float dc_a, void* params){
  ledcWrite(((ESP32LEDCDriverParams*)params)->channels[0], _constrain(_PWM_RES*dc_a, 0, _PWM_RES));
}