3 Motor::Motor(uint8_t pin, ledc_timer_t timer, ledc_channel_t channel){
11 pinMode(this->
pin,OUTPUT);
12 ledc_channel_config_t channelConfig = {
13 .gpio_num = this->
pin,
16 .intr_type = LEDC_INTR_DISABLE,
17 .timer_sel = this->
timer,
21 ledc_channel_config(&channelConfig);
22 Serial.println(
"Motor begin done");
29 for(
int i = 0;i<difference;i+=difference/20){
30 this->duty += difference/20;
36 for(
int i = 0;i>difference;i-=abs(difference/20)){
37 this->duty -= abs(difference/20);