public class IRTransmitter extends PWMComponent
To send IR codes, the IR transmitter LED is quickly pulsed (PWM - pulse width modulated) at a high frequency of (for example) 38KHz and then that PWM is likewise pulsed on and off much slower, at times that are about 1-3 ms long.
Why using a carrier frequency ? McHobby
Datasheet: Infrared LED
Example of use: IRTransmitterExample
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CARRIER_FREQUENCY
The carrier frequency of the infrared signal should be 38kHz.
|
static int |
PWM_RANGE_GENERATOR
Range register in the PWM generator.
|
DEFAULT_RPI_PWM_CLOCK_FREQUENCY, PCA9685_PULSE_TICKS, pinNumber
Constructor and Description |
---|
IRTransmitter(PWMPin pin)
Constructor for a default infrared transmitter connected to a specific PWM pin,
using the default carrier frequency (
DEFAULT_CARRIER_FREQUENCY ). |
IRTransmitter(PWMPin pin,
int carrierFrequency)
Constructor for an infrared transmitter connected to a specific the PWM pin,
and using the specified carrierFrequency.
|
Modifier and Type | Method and Description |
---|---|
void |
transmitSignal(IRSignal signal)
Sends an IRSignal through the IRTransmitter connected to the setted PWM pin.
|
getType, setPWM, setPWM, setPWMFreq
public static final int DEFAULT_CARRIER_FREQUENCY
Each PWM period is then 26.32μs long.
public static final int PWM_RANGE_GENERATOR
The values sent to the generator must be in the [0; PWM_RANGE_GENERATOR] range.
public IRTransmitter(PWMPin pin)
DEFAULT_CARRIER_FREQUENCY
).pin
- the PWMPin used to send the PWM signals.IRTransmitter(PWMPin, int)
public IRTransmitter(PWMPin pin, int carrierFrequency)
pin
- the PWMPin used to send the PWM signals.carrierFrequency
- the carrier frequency used to send the infrared signals.