FYI, I just tried your code in PlatformIO and it worked right away. (Just had to include the Arduino header.)
Which board spec did you use?
Same as in the earlier tests: "Espressif ESP32 dev module" (esp32dev) board definition with a 38-pin ESP32-WROOM board.
That's pretty critical.
No shit, Sherlock... You think that's not obvious to me after everything I've written and asked so far, including (before knowing you were a professional dev)
asking you to verify that you were using the correct board definition that I know for a fact to be the correct one for that board type?!? (Programming them with PlatformIO is exactly what I've been doing quite a bit of the last several months.)
And did you actually check that the GPIO pins are toggling? You didn't just check that it compiles and downloads?
1. To me, "works" means the code must actually accomplish what it's supposed to do, which in this case is to blink LEDs. I said it "worked", not that it merely compiled and uploaded. I have 4 LEDs happily blinking in front of me at the 4 different blink rates you defined.
2. From my prior responses it should be obvious that I know that code that compiles need not necessarily
work, given that I provided an explicit example of how to make the code compile but
not work.
This pretty much conclusively confirms it's not a problem with the board definition in PlatformIO, which as I said, was spectacularly unlikely to be the case. (And a bit of a... bold accusation, to say the least.)
Software developers across the world are laughing maniacally at the suggestion that a software product is spectacularly unlikely to contain bugs.
No, but the board definitions are such a fundamental thing that for a board this popular, the chances that
you found a new bug in the board definition asymptotically approach zero. See also the hyperlink I edited into my reply while you were writing your response.
On the off chance that something in your build got borked and is now interfering, try cleaning the PlatformIO project (the trash can in the bottom toolbar, right next to the upload and serial monitor buttons), then uploading again.
Also, if you've closed and opened things (especially removing folders from the Explorer tab, the only way to "close" a project) make certain that you then reopened the project using the Open Project command in PlatformIO. Opening it just using the VS Code commands will not load everything that needs to.
That's worth trying. In fact, I shall reinstall the whole thing from scratch at some point and try again.
Well, just try the opening from within PlatformIO and cleaning first, it's a ton less work!