0%

STM32/ESP32 Arduino LED 快速验证程序

开发板管理器地址:

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);
}

参考:

  • 本文作者: 6x
  • 本文链接: https://6xyun.cn/article/179
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-ND 许可协议。转载请注明出处!