Movatterモバイル変換


[0]ホーム

URL:


Sorry, we no longer support your browser
Please upgrade toMicrosoft Edge,Google Chrome, orFirefox. Learn more about ourbrowser support.
Skip to main content

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities includingStack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Loading…
Arduino

Timeline forHow to avoid blocking while loop reading Serial?

Current License: CC BY-SA 3.0

7 events
when toggle formatwhatbylicensecomment
Oct 24, 2020 at 21:48voteacceptGeorge Profenza
Jun 17, 2020 at 8:21historyeditedCommunityBot
Commonmark migration
Nov 17, 2017 at 12:28commentadded dannyf "Serial.read() is not blocking, it always returns immediately with a byte 0-255 or -1 if there is no character to read." unless it returns a multi-byte data type, it couldn't return 0-255 or -1 -> as -1 is 128. it likely returns 0-127 and -1 instead.
Mar 31, 2015 at 1:33voteacceptGeorge Profenza
Oct 24, 2020 at 21:48
Mar 30, 2015 at 14:38commentadded Wirewrap Serial.read() reads from a 64 bytes buffer. If you can avoid filling up the buffer you will be okay.
Mar 29, 2015 at 21:11commentadded George Profenza Interesting indeed(+1). I will try to adapt the code without using available() and simply checking ifSerial.read() > -1. Is there a change of missing a byte this way ?
Mar 29, 2015 at 20:14history answeredWirewrapCC BY-SA 3.0

[8]ページ先頭

©2009-2025 Movatter.jp