include Software Serial h Software Serial my Serial10

  • Slides: 10
Download presentation

다른쪽 아두이노에서 값 읽어 오기 #include <Software. Serial. h> Software. Serial my. Serial(10, 11);

다른쪽 아두이노에서 값 읽어 오기 #include <Software. Serial. h> Software. Serial my. Serial(10, 11); void setup() { my. Serial. begin(115200); } 다른 아두이노 보드에서 수신된 문자열 값을 이용하여 13번 LED 제어하기 void loop() { //다른 아두이노 보드에서 문자열을 읽어옵니다. if (my. Serial. available()) { String s = my. Serial. read. String. Until('r') if (s == "On") Digital. Write(13, HIGH) else Digital. Write(13, LOW) } delay(100) } 10