You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi
Thanks for a great help with my project but I wish I had a diode that gave light so I could see what function I had activated I am a little new to it has so can not just see how to program myself out of so if you have activated eg 10 degrees then there is a diode that lights up in the button or next to it.
Hope someone can help me.
Have attached a picture the first model I have made without light.
and the code i use.
while (char symbol = *symbols++)
{
switch (symbol)
{
case '1':
irSender.space(IR_ONE_SPACE);
irSender.mark(IR_BIT_MARK);
break;
case '0':
irSender.space(IR_ZERO_SPACE);
irSender.mark(IR_BIT_MARK);
break;
case 'W':
irSender.space(IR_PAUSE_SPACE);
break;
case 'H':
irSender.mark(IR_HEADER_MARK);
break;
case 'h':
irSender.space(IR_HEADER_SPACE);
irSender.mark(IR_BIT_MARK);
break;
}
}
Hi
Thanks for a great help with my project but I wish I had a diode that gave light so I could see what function I had activated I am a little new to it has so can not just see how to program myself out of so if you have activated eg 10 degrees then there is a diode that lights up in the button or next to it.
Hope someone can help me.
Have attached a picture the first model I have made without light.
and the code i use.
Yours sincerely
Mikael
Sluk = shut down
Code
#include <Arduino.h>
#include <HeatpumpIR.h> // https://github.com/ToniA/arduino-heatpumpir
#include <Button.h> // http://playground.arduino.cc/Code/Button
#define IR_HEADER_MARK 3500
#define IR_HEADER_SPACE 1800
#define IR_BIT_MARK 420
#define IR_ONE_SPACE 1350
#define IR_ZERO_SPACE 470
#define IR_PAUSE_SPACE 10000
// Heatpump states
const byte heatpumpOff = 0;
const byte heatpumpNormal = 1;
const byte heatpumpMaintenance = 2;
Button relay1 = Button(7, INPUT_PULLUP); // Heatpump ON 10
Button relay2 = Button(8, INPUT_PULLUP); // Heatpump ON 18
Button relay3 = Button(10, INPUT_PULLUP); // Heatpump ON 20
Button relay4 = Button(11, INPUT_PULLUP); // Heatpump ON 22
Button relay5 = Button(12, INPUT_PULLUP); // Heatpump OFF
IRSenderPWM irSender(9); // IR led on Duemilanove digital pin 9, using Arduino PWM
byte heatpumpState = heatpumpOff;
void sendRaw(char * symbols)
{
irSender.space(0);
irSender.setFrequency(38);
while (char symbol = *symbols++)
{
switch (symbol)
{
case '1':
irSender.space(IR_ONE_SPACE);
irSender.mark(IR_BIT_MARK);
break;
case '0':
irSender.space(IR_ZERO_SPACE);
irSender.mark(IR_BIT_MARK);
break;
case 'W':
irSender.space(IR_PAUSE_SPACE);
break;
case 'H':
irSender.mark(IR_HEADER_MARK);
break;
case 'h':
irSender.space(IR_HEADER_SPACE);
irSender.mark(IR_BIT_MARK);
break;
}
}
irSender.space(0);
}
void setup(){
Serial.begin(9600);
delay(500);
Serial.println(F("Starting..."));
}
void loop(){
if (relay1.isPressed()) {
// Heat 10
}
if (relay2.isPressed()) {
// Heat 18
}
if (relay3.isPressed()) {
// Heat 20
}
if (relay4.isPressed()) {
// Heat 22
}
if (relay5.isPressed()) {
// Heat OFF
delay(500); // 0.5 seconds delay
}
The text was updated successfully, but these errors were encountered: