arduino-heatpumpir icon indicating copy to clipboard operation
arduino-heatpumpir copied to clipboard

Inverted PWM Signal?

Open tswonke opened this issue 1 year ago • 3 comments

Sorry for a maybe dumb question, but I don't understand the generated signal. When I start the ESP32 the signal on my chosen GPIO is LOW. With the first sent signal it flips to HIGH (s. attached picture) and stays there for ever (until the next signal):

IMG_4773 IMG_4774

Is this on purpose? From my understanding this would mean that an attached IR-LED would constantly be glowing. Or do I have to invert the signal with a transistor?

My code is very simplified for testing:

#include <Arduino.h>
#include <FujitsuHeatpumpIR.h>

IRSenderESP32 irSender(33, 0);
FujitsuHeatpumpIR *heatpumpIR;

void setup()
{
  Serial.begin(115200);
  delay(500);
  heatpumpIR = new FujitsuHeatpumpIR();
}

void loop()
{
  heatpumpIR->send(irSender, POWER_ON, MODE_FAN, FAN_3, 18, VDIR_AUTO, HDIR_AUTO);
  delay(2000);
}

tswonke avatar Jul 27 '24 14:07 tswonke

After changing IRSenderESP32.cpp by moving pinMode(_pin, OUTPUT); from Line 46 to 50

image

the signal seems to be right:

IMG_4775

... at least in my eyes. Maybe I'm wrong? Sender is working, Fujitsu AC reacts.

tswonke avatar Jul 27 '24 19:07 tswonke

You're probably right on this one... Would you create a pull request with the fix (and please verify that it's also working correctly on non-inverted case)?

ToniA avatar Aug 10 '24 08:08 ToniA

Ok, I will probably come back to this this week or next week

tswonke avatar Aug 20 '24 07:08 tswonke