C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\tools\win>rem: Using the open source texane-stlink instead of the proprietary STM stlink exe
可以运行起来 呼吸灯。但是我在呼吸灯里加上串口打印的代码,串口无输出,我测试了硬件串口是OK的,用其它编译器的代码。
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
// the loop function runs over and over again forever
void loop() {
int sensorValue = analogRead(0);
float voltage = sensorValue * (5.0 / 1023.0);
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second