Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inverted PWM Signal? #177

Open
tswonke opened this issue Jul 27, 2024 · 3 comments
Open

Inverted PWM Signal? #177

tswonke opened this issue Jul 27, 2024 · 3 comments

Comments

@tswonke
Copy link

tswonke commented Jul 27, 2024

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
Copy link
Author

tswonke commented Jul 27, 2024

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.

@ToniA
Copy link
Owner

ToniA commented Aug 10, 2024

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)?

@tswonke
Copy link
Author

tswonke commented Aug 20, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants