From d40b5b73c1900b89761fa38d87401a762a7e32a6 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Mon, 26 Jul 2010 20:25:13 +0000 Subject: [PATCH] IR Tweaks (inverted + higher power cycle) --- rf433ctl/IRremote/IRremote.cpp | 4 ++-- rf433ctl/rf433ctl.pde | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rf433ctl/IRremote/IRremote.cpp b/rf433ctl/IRremote/IRremote.cpp index bb6083e..00ccebf 100644 --- a/rf433ctl/IRremote/IRremote.cpp +++ b/rf433ctl/IRremote/IRremote.cpp @@ -198,7 +198,7 @@ void IRsend::enableIROut(int khz) { TIMSK2 &= ~_BV(TOIE2); //Timer2 Overflow Interrupt pinMode(3, OUTPUT); - digitalWrite(3, LOW); // When not sending PWM, we want it low + digitalWrite(3, HIGH); // When not sending PWM, we want it low // COM2A = 00: disconnect OC2A // COM2B = 00: disconnect OC2B; to send signal set to 10: OC2B non-inverted @@ -209,7 +209,7 @@ void IRsend::enableIROut(int khz) { // The top value for the timer. The modulation frequency will be SYSCLOCK / 2 / OCR2A. OCR2A = SYSCLOCK / 2 / khz / 1000; - OCR2B = OCR2A / 3; // 33% duty cycle + OCR2B = OCR2A / 4; // 33% duty cycle } IRrecv::IRrecv(int recvpin) diff --git a/rf433ctl/rf433ctl.pde b/rf433ctl/rf433ctl.pde index ae61d39..c4a3133 100644 --- a/rf433ctl/rf433ctl.pde +++ b/rf433ctl/rf433ctl.pde @@ -347,7 +347,9 @@ void setup() digitalWrite(PANIC_BUTTON_PIN, HIGH); // turn on pullup resistors analogWrite(BLUELED_PWM_PIN,0); analogWrite(BLUELED2_PWM_PIN,255); //pwm sink(-) instead of pwm + (better for mosfets) - + pinMode(IRREMOTE_SEND_PIN, OUTPUT); + digitalWrite(IRREMOTE_SEND_PIN, HIGH); + Serial.begin(9600); onewire.reset(); -- 1.7.10.4