Description read() reads characters from an incoming stream to the buffer. This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). Syntax stream.read() Parameters stream : an instance of a class that inherits from Stream. Returns the first byte of incoming data available (or […]
Description available() gets the number of bytes available in the stream. This is only for bytes that have already arrived. This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). Syntax stream.available() Parameters stream : an instance of a class that inherits from Stream. […]
Description setTimeout() sets the maximum milliseconds to wait for stream data, it defaults to 1000 milliseconds. This function is part of the Stream class, and is called by any class that inherits from it (Wire, Serial, etc). Syntax stream.setTimeout(time) Parameters stream : an instance of a class that inherits from Stream. time : timeout duration […]
Description Called when data is available. Use Serial.read() to capture this data. Syntax All boards: void serialEvent(){ //statements } void serialEvent1(){ //statements } 86Duino One specific: void serialEvent2(){ //statements } void serialEvent3(){ //statements } void serialEvent485(){ //statements } 86Duino EduCake specific: void serialEvent2(){ //statements } void serialEvent3(){ //statements […]
Description Writes binary data to the serial port. This data is sent as a byte or series of bytes; to send the characters representing the digits of a number use the print() function instead. Syntax Serial.write(val) Serial.write(str) Serial.write(buf, len) Parameters val: a value to send as a single byte str: a string to send as […]
Description Serial.setTimeout() sets the maximum milliseconds to wait for serial data when using Serial.readBytesUntil() or Serial.readBytes(). It defaults to 1000 milliseconds. Serial.setTimeout() inherits from the Stream utility class. Syntax Serial.setTimeout(time) Parameters time : timeout duration in milliseconds (long). Returns None See also - Serial - Stream - Stream.setTimeout() Language Reference Home The text of the […]
Description Serial.readBytesUntil() reads characters from the serial buffer into an array. The function terminates if the terminator character is detected, the determined length has been read, or it times out (see Serial.setTimeout()). Serial.readBytesUntil() returns the number of characters read into the buffer. A 0 means no valid data was found. Serial.readBytesUntil() inherits from the Stream […]
Description Serial.readBytes() reads characters from the serial port into a buffer. The function terminates if the determined length has been read, or it times out (see Serial.setTimeout()). Serial.readBytes() returns the number of characters placed in the buffer. A 0 means no valid data was found. Serial.readBytes() inherits from the Stream utility class. Syntax Serial.readBytes(buffer, length) […]
Description Reads incoming serial data. read() inherits from the Stream utility class. Syntax All boards: Serial.read() Serial1.read() 86Duino One specific: Serial2.read() Serial3.read() Serial485.read() 86Duino EduCake specific: Serial2.read() Serial3.read() Serial232.read() Parameters None Returns the first byte of incoming serial data available (or -1 if no data is available) – int Example See also - Serial - […]
Description Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or ‘\r’) and a newline character (ASCII 10, or ‘\n’). This command takes the same forms as Serial.print(). Syntax Serial.println(val) Serial.println(val, format) Parameters val: the value to print – any data type format: specifies the number […]