refactored code

This commit is contained in:
hhaupt
2024-06-13 00:55:30 +02:00
parent 3c0cbe1941
commit 448e7e3f4b
7 changed files with 16 additions and 31 deletions

View File

@@ -1,9 +1,7 @@
#include "InfraredLight.h"
#define pwmSpeedMode LEDC_LOW_SPEED_MODE
#define fooPin 13
#define footimer LEDC_TIMER_0
#define foochannel LEDC_CHANNEL_0
InfraredLED::InfraredLED(uint8_t pin,ledc_timer_t timer, ledc_channel_t channel){
this->ledPin = pin;
this->timer = timer;
@@ -53,7 +51,7 @@ void InfraredLED::setState(bool state){
};
void InfraredLED::sendFrequency(uint16_t frequency){
// ledc_set_freq(pwmSpeedMode,timer,frequency);
ledc_set_freq(pwmSpeedMode,timer,frequency);
ledc_set_duty(pwmSpeedMode,channel,512);
ledc_update_duty(pwmSpeedMode,channel);
};