开发板管理器地址:
https://espressif.github.io/arduino-esp32/package_esp32_index.json
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
测试代码:
#define TARGET_ESP32
#ifdef TARGET_ESP32
// %LocalAppData%\Arduino15\packages\esp32\hardware\esp32\2.0.11\variants\esp32\pins_arduino.h
#define LED_BUILTIN T2
#endif
#ifdef TARGET_STM32
// %LocalAppData%\Arduino15\packages\STMicroelectronics\hardware\stm32\2.6.0\variants\STM32F1xx\F103C8T_F103CB(T-U)\variant_generic.h
#define LED_BUILTIN PC13
#endif
void setup() {
// put your setup code here, to run once:
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);
}
参考: