시리얼 수신 버퍼에 있는 데이터를 읽고 Timeout 발생 시 읽은 데이터를 String 형태로 리턴합니다.
Serial.readString()
String - 읽은 데이터
void setup() { Serial.begin(9600); } void loop() { if(Serial.available()) { //데이터를 String 형태로 읽음 String s = Serial.readString(); Serial.println(s); } } |
Created with the Personal Edition of HelpNDoc: Write EPub books for the iPad