I am new to ESP32 and trying to learn how to use it and I’m trying to with a simple and basic project which is LED Blinking. I have ESP32-WROOM-32U and ESP32-C3-32S and both of them gets to me a success build and upload; however, the LED does not blinking. ESP32-C3-32S only works with espidf framework, so I am working with ESP32-WROOM-32U. I tried to use in both Arduino IDE and VSCode Platformio. and still did not get any conclusion. I went to Platformio in vscode and selected test form Advanced and it failed.
I tried in some other boards that works on my ESP32
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
I also changed the pin of LED
#include <Arduino.h>
void setup(){
pinMode(2, OUTPUT);
}
void loop(){
digitalWrite(2,HIGH);
delay(1000);
digitalWrite(2,LOW);
delay(1000);
}
And this is the outcome of test result.
Verbose mode can be enabled via `-v, --verbose` option
Collected 1 items
Processing * in esp32dev environment
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Building...
.pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o):(.literal._Z8loopTaskPv+0x8): undefined reference to `setup()'
.pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o):(.literal._Z8loopTaskPv+0xc): undefined reference to `loop()'
.pio\build\esp32dev\libFrameworkArduino.a(main.cpp.o): In function `loopTask(void*)':
C:\Users\MSI\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:18: undefined reference to `setup()'
C:\Users\MSI\.platformio\packages\framework-arduinoespressif32\cores\esp32/main.cpp:21: undefined reference to `loop()'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp32dev\firmware.elf] Error 1
========================================================================== [FAILED] Took 8.93 seconds ==========================================================================
Test Environment Status Duration
------ ------------- -------- ------------
* esp32dev FAILED 00:00:08.929
===================================================================== 1 failed, 0 succeeded in 00:00:08.929 ====================================================================="C:\Users\MSI\.platformio\penv\Scripts\platformio.exe 'test', '--environment', 'esp32dev'" terminal işlemi şu çıkış koduyla sonlandırıldı: 1.