Dezibot 4
Loading...
Searching...
No Matches
InfraredLight.h
Go to the documentation of this file.
1
11#ifndef InfraredLight_h
12#define InfraredLight_h
13#include <stdint.h>
14#include <Arduino.h>
15#include "driver/ledc.h"
16
17
19 public:
20 InfraredLED(uint8_t pin, ledc_timer_t timer, ledc_channel_t channel);
21 void begin(void);
26 void turnOn(void);
32 void turnOff(void);
39 void setState(bool state);
46 void sendFrequency(uint16_t frequency);
47 protected:
48 uint8_t ledPin;
49 ledc_timer_t timer;
50 ledc_channel_t channel;
51 ledc_timer_config_t pwmTimer;
52 ledc_channel_config_t pwmChannel;
53};
54
56public:
57 //Do something for correct resource sharing
58 InfraredLED bottom = InfraredLED(IRBottomPin,LEDC_TIMER_0,LEDC_CHANNEL_0);
59 InfraredLED front = InfraredLED(IRFrontPin,LEDC_TIMER_1,LEDC_CHANNEL_1);
60 void begin(void);
61
62protected:
63 static const uint8_t IRFrontPin = 14;
64 static const uint8_t IRBottomPin = 13;
65};
66
67
68#endif //InfraredLight_h
void begin(void)
InfraredLED(uint8_t pin, ledc_timer_t timer, ledc_channel_t channel)
ledc_timer_t timer
void turnOn(void)
enables selected LED
ledc_channel_config_t pwmChannel
void turnOff(void)
disables selected LED
void sendFrequency(uint16_t frequency)
starts flashing the IRLed with a specific frequency Won't stop automatically, must be stopped by call...
ledc_channel_t channel
uint8_t ledPin
ledc_timer_config_t pwmTimer
void setState(bool state)
changes state of selected LED depending on the state
InfraredLED bottom
void begin(void)
static const uint8_t IRFrontPin
static const uint8_t IRBottomPin
InfraredLED front