I have no idea why my board is doing this, but here goes.
I create a simple circuit, with the positive lead of an LED connected to one of many of the GPIO pins on the ESP32 WROOM.
The negative lead, I connect to GND.
In my code, I do pinMode(, OUTPUT) in setup(), and digitalWrite(, HIGH) in loop().
I run the sketch.
For some reason I can't get the pin on the ESP32 to go high.
If I connect my LED directly to 3.3 V (or initially HIGH pins like pin 3) it lights up fine. If I connect a multimeter to the GPIO pin I'm trying to set to HIGH, I get 0V.
I agree that it's possible. Per the docs there is a default PWM output pin for transmitting, but I don't see anywhere that tells me entire swaths of the GPIO is reserved.
I've tried multiple pins on the board, and as soon as I make that single include, I can't bring them HIGH anymore.
Maybe if I was the author - there's dozens of files that get included as a result of that single include. Definitely trying to work through it on my own. Will send and update if I find anything.
You need a series resistor with any LED. put in 50-150 ohms and see if that doesn't fix it. The LED alone will sink more than the output pin can drive.
Series resistor is already in place - I can power and see the LED working just fine if I connecting it directly to the 3V3 pin, or one of the GPIO pins that stays HIGH (like RXO).
The problem seems to be that I lose the ability to set GPIO pins to high when I use the library.
The library in question is using the ESP32's LEDC API to drive the PWM signal it generates. If the OP is using a hardware timer the LEDC APi being used by the infraredthingy library and the way the hardware timer is being assigned, a conflict of timer assignment by the API can happen. If the OP is using the ESP32's hardware timer, I recommend the OP use the 4th (timer3) timer to avoid issues.
@Idahowalker - my problem isn't related to PWM output of the library to send IR... that actually works great on the pin specified.
It's just this odd behavior that when I try to use the library, I suddenly lose the ability to control other GPIO pins for simpler LED uses (like having a LED blink when a signal is received or transmitted). No timer or PWM needed for my problem... just the ability to set the pin to HIGH.
Granted - I'm just curious to know if my pinMode/digitalWrite code is correct in just using 21. The gpio_* code definitely works and I'm no longer stuck, but it's a head scratcher to me to understand why the arduino core code doesn't work.
I was mostly asking if 21/pinMode/digitalWrite is the equivalent of GPIO_NUM_21/gpio_set_direction/gpio_set_level.
@Idahowalker Well - thank you so much for offering the suggestion. Works for me, and I'm likely to stay on ESP32 (moving from Uno), so maybe trying to get the pinMode/digitalWrite version working isn't that important (for me).