-
Notifications
You must be signed in to change notification settings - Fork 123
Closed
Description
Hi,
I used Serial.readString() method to receive string message from string monitor.
but it returns empty string.
#include "Arduino.h"
#include "FreeRTOS_AVR.h"
void setup()
{
Serial.begin(9600);
xTaskCreate(vTaskSerial, NULL, configMINIMAL_STACK_SIZE, NULL, 2, NULL);
vTaskStartScheduler();
while(1);
}
void vTaskSerial(void *pvParameters) {
while(1) {
if(Serial.available() > 0) {
Serial.println("Serial is available");
String msg = Serial.readString();
Serial.println(msg);
Serial.println("Message printing ends");
}
vTaskDelay(100 / portTICK_PERIOD_MS);
}
}
void loop() {
}
>>Send to COM3: "hello"<<
Serial is available
Message printing ends
Metadata
Metadata
Assignees
Labels
No labels