add support for sending single bits. Needed for Nibe heatpump which sends 90 bits
This commit is contained in:
parent
7e9134ee8e
commit
b8ce01554a
|
@ -10,9 +10,9 @@ IRSender::IRSender(uint8_t pin)
|
|||
|
||||
|
||||
// Send a uint8_t (8 bits) over IR
|
||||
void IRSender::sendIRbyte(uint8_t sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength)
|
||||
void IRSender::sendIRbyte(uint8_t sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength, uint8_t bitCount)
|
||||
{
|
||||
for (int i=0; i<8 ; i++)
|
||||
for (int i=0; i<bitCount ; i++)
|
||||
{
|
||||
if (sendByte & 0x01)
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@ class IRSender
|
|||
public:
|
||||
virtual ~IRSender() = default;
|
||||
virtual void setFrequency(int frequency);
|
||||
void sendIRbyte(uint8_t sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength);
|
||||
void sendIRbyte(uint8_t sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength, uint8_t bitCount = 8);
|
||||
uint8_t bitReverse(uint8_t x);
|
||||
virtual void invert(bool inverted);
|
||||
virtual void space(int spaceLength);
|
||||
|
|
Loading…
Reference in New Issue