Updated HeatpumpIR, to a version which uses the native Arduino IDE 1.6 PROGMEM definitions
This commit is contained in:
@@ -1,47 +1,40 @@
|
||||
#include <Arduino.h>
|
||||
#include <HisenseHeatpumpIR.h>
|
||||
|
||||
IRSender irSender(3); // IR led on Duemilanove digital pin 3
|
||||
|
||||
HisenseHeatpumpIR *heatpumpIR;
|
||||
HisenseHeatpumpIR *heatpumpIR;
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
||||
Serial.begin(9600);
|
||||
delay(500);
|
||||
heatpumpIR = new HisenseHeatpumpIR();
|
||||
Serial.println(F("Starting"));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
int i = 0;
|
||||
prog_char* buf;
|
||||
const char* buf;
|
||||
|
||||
|
||||
// Send the same IR command to all supported heatpumps
|
||||
Serial.print(F("Sending IR to "));
|
||||
// Print the model
|
||||
buf = (prog_char*)heatpumpIR->model();
|
||||
buf = heatpumpIR->model();
|
||||
// 'model' is a PROGMEM pointer, so need to write a byte at a time
|
||||
while (char modelChar = pgm_read_byte(buf++))
|
||||
{
|
||||
Serial.print(modelChar);
|
||||
}
|
||||
Serial.print(F(", info: "));
|
||||
// Print the info
|
||||
buf = (prog_char*)heatpumpIR->info();
|
||||
// Print the info
|
||||
buf = heatpumpIR->info();
|
||||
// 'info' is a PROGMEM pointer, so need to write a byte at a time
|
||||
while (char infoChar = pgm_read_byte(buf++))
|
||||
{
|
||||
Serial.print(infoChar);
|
||||
}
|
||||
Serial.println();
|
||||
Serial.println();
|
||||
|
||||
|
||||
heatpumpIR->send(irSender, POWER_ON, MODE_HEAT, FAN_3, 30, VDIR_AUTO, HDIR_AUTO);
|
||||
delay(1500);
|
||||
heatpumpIR->send(irSender, POWER_ON, MODE_DRY, FAN_2, 20, VDIR_AUTO, HDIR_AUTO);
|
||||
@@ -50,7 +43,6 @@ void loop()
|
||||
delay(1500);
|
||||
heatpumpIR->send(irSender, POWER_ON, MODE_COOL, FAN_1, 18, VDIR_AUTO, HDIR_AUTO);
|
||||
delay(2500);
|
||||
heatpumpIR->send(irSender, POWER_OFF, NULL, NULL, NULL, NULL, NULL);
|
||||
heatpumpIR->send(irSender, POWER_OFF, MODE_COOL, FAN_1, 18, VDIR_AUTO, HDIR_AUTO);
|
||||
delay(1500);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user