I am using Visual Studio Code/PlatformIO, and this morning I had some issues with a different project so I tried updating PlatformIO. This evening I discovered that the PWM control of these pins seems to have stopped working - I'm pretty sure it's related to the update. Everything else still works: my app still generates the web pages to control the display, various buttons on my PCB still perform their intended functions, and I can still even make out very faint characters on the display. But I can no longer control the brightness or contrast. The backlight is off, and the contrast seems to be at its highest.
I used a basic multimeter to check the voltage on the two PWM pins, and they both seem to be at 0V, regardless of the slider settings.
I originally installed Visual Studio/PlatformIO in late January 2022, and unless it does so by itself in the background, it hadn't been updated since then until this morning.
So my question for the forum is whether an update this morning could somehow have changed the PWM behaviour of GPIO13 and GPIO21.
My code, which worked until this morning, is:
Code: Select all
const int freq = 5000;
const int ledChannel = 0;
const int ConChannel = 1;
const int resolution = 8;
.
.
.
ledcSetup(ledChannel, freq, resolution);
ledcAttachPin(BackLightpin, ledChannel);
ledcSetup(ConChannel, freq, resolution);
ledcAttachPin(Contrastpin, ConChannel);
.
pinMode(BackLightpin, OUTPUT);
pinMode(Contrastpin, OUTPUT);
.
.
.
ledcWrite(ledChannel, brightnessOn);
ledcWrite(ConChannel, 255-Contrast);
Code: Select all
platform = espressif32
Code: Select all
platform = https://github.com/platformio/platform-espressif32.git
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.5.0
But this fails with various error messages, so I must be doing something wrong in trying to get back to an earlier version.
It may be nothing to do with updating, but that is certainly how it appears at this stage. I'm out of ideas to fix this, so would appreciate any help.