Infrared4Arduino 1.2.3
Loading...
Searching...
No Matches
IrSenderSimulator.cpp
Go to the documentation of this file.
1#include "IrSenderSimulator.h"
2
3void IrSenderSimulator::send(const IrSequence& irSequence, frequency_t frequency, dutycycle_t dutyCycle) {
4 if (! irSequence)
5 return;
6
7 stream.print(F("IrSenderSimulator: "));
8 bool printedSomething = IrSignal::dumpFrequency(stream, frequency);
9 if (printedSomething)
10 stream.print(' ');
11 printedSomething = IrSignal::dumpDutyCycle(stream, dutyCycle);
12 if (printedSomething)
13 stream.print(' ');
14 irSequence.dump(stream, true);
15}
int8_t dutycycle_t
Type for duty cycle in percent.
Definition: InfraredTypes.h:36
uint32_t frequency_t
Type for modulation frequency in Hz.
Definition: InfraredTypes.h:31
void send(const IrSequence &irSequence, frequency_t frequency=IrSignal::defaultFrequency, dutycycle_t dutyCycle=Board::defaultDutyCycle)
Sends an IrSequence with the prescribed frequency.
This class consists of a vector of durations.
Definition: IrSequence.h:11
void dump(Stream &stream, bool usingSigns=false) const
Prints the IrSequence on the stream provided.
Definition: IrSequence.cpp:47
bool dumpDutyCycle(Stream &stream) const
If the duty cycle is sensible, print it to the stream and return true.
Definition: IrSignal.h:193
bool dumpFrequency(Stream &stream) const
If the frequency is sensible, print it to the stream and return true.
Definition: IrSignal.h:176