Articles Posted by the Author:

  • write()

    write()

    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 […]


  • Serial.setTimeout()

    Serial.setTimeout()

    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 […]


  • Serial.readBytesUntil()

    Serial.readBytesUntil()

    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 […]


  • Serial.readBytes()

    Serial.readBytes()

    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) […]


  • read()

    read()

    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 - […]


  • println()

    println()

    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 […]


  • print()

    print()

    Description Prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers are printed using an ASCII character for each digit. Floats are similarly printed as ASCII digits, defaulting to two decimal places. Bytes are sent as a single character. Characters and strings are sent as is. For example: […]


  • peek()

    peek()

    Description Returns the next byte (character) of incoming serial data without removing it from the internal serial buffer. That is, successive calls to peek() will return the same character, as will the next call to read(). peek() inherits from the Stream utility class. Syntax All boards: Serial.peek() Serial1.peek() 86Duino One specific: Serial2.peek() Serial3.peek() Serial485.peek() 86Duino […]


  • parseInt()

    parseInt()

    Description Looks for the next valid integer in the incoming serial stream. parseInt() inherits from the Stream utility class. If no valid integer is found within one second (adjustable through Serial.setTimeout() ) a default value of 0 will be returned. Syntax All boards: Serial.parseInt() Serial1.parseInt() 86Duino One specific: Serial2.parseInt() Serial3.parseInt() Serial485.parseInt() 86Duino EduCake specific: Serial2.parseInt() […]


  • Serial.parseFloat()

    Serial.parseFloat()

    Description Serial.parseFloat() returns the first valid floating point number from the Serial buffer. Characters that are not digits (or the minus sign) are skipped. parseFloat() is terminated by the first character that is not a floating point number. Serial.parseFloat() inherits from the Stream utility class. Syntax Serial.parseFloat() Parameters none Returns float See also - Stream […]