Updated HeatpumpIR, to a version which uses the native Arduino IDE 1.6 PROGMEM definitions
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
//
|
||||
// For PWM on Arduino, see http://playground.arduino.cc/Main/TimerPWMCheatsheet
|
||||
|
||||
IRSender::IRSender(byte pin)
|
||||
IRSender::IRSender(uint8_t pin)
|
||||
{
|
||||
_pin = pin;
|
||||
}
|
||||
@@ -72,8 +72,8 @@ void IRSender::setFrequency(int frequency)
|
||||
}
|
||||
}
|
||||
|
||||
// Send a byte (8 bits) over IR
|
||||
void IRSender::sendIRByte(byte sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength)
|
||||
// Send a uint8_t (8 bits) over IR
|
||||
void IRSender::sendIRbyte(uint8_t sendByte, int bitMarkLength, int zeroSpaceLength, int oneSpaceLength)
|
||||
{
|
||||
for (int i=0; i<8 ; i++)
|
||||
{
|
||||
@@ -93,8 +93,8 @@ void IRSender::sendIRByte(byte sendByte, int bitMarkLength, int zeroSpaceLength,
|
||||
}
|
||||
|
||||
// The Carrier IR protocol has the bits in a reverse order (compared to the other heatpumps)
|
||||
// See http://www.nrtm.org/index.php/2013/07/25/reverse-bits-in-a-byte/
|
||||
byte IRSender::bitReverse(byte x)
|
||||
// See http://www.nrtm.org/index.php/2013/07/25/reverse-bits-in-a-uint8_t/
|
||||
uint8_t IRSender::bitReverse(uint8_t x)
|
||||
{
|
||||
// 01010101 | 10101010
|
||||
x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
|
||||
|
||||
Reference in New Issue
Block a user