this is my sample code and I found if I close the serial monitor few minute the program will stop blinking when I open the monitor it will continue run.
I thing is because of the usb serial buffer full or what … is this a bug or normal ? how do I check the usb buffer is full when that is unable to send out the data ? because normally HW serial system wont care the user is received the data or not but USB ?
byte LED_BUILTIN2 = PA7;
byte LED_BUILTIN1 = PA6;
// the setup function runs once when you press reset or power the board
void setup() {
//setupUSB();
// initialize digital pin LED_BUILTIN as an output.
//delay(3000);
SerialUSB.begin(115200);
//delay(3000);
SerialUSB.println("OK!!");
pinMode(LED_BUILTIN1, OUTPUT);
pinMode(LED_BUILTIN2, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN2, HIGH); // turn the LED on (HIGH is the voltage level)
SerialUSB.println("OK!!");
delay(100); // wait for a second
digitalWrite(LED_BUILTIN1, HIGH); // turn the LED off by making the voltage LOW
SerialUSB.println("OK!!");
delay(100); // wait for a second
digitalWrite(LED_BUILTIN2, LOW); // turn the LED on (HIGH is the voltage level)
SerialUSB.println("OK!!");
delay(100); // wait for a second
digitalWrite(LED_BUILTIN1, LOW); // turn the LED off by making the voltage LOW
delay(100); // wait for a second
}