Serial

Serial

Methods


Blockly.C['serial_read_bytes']()

Code Equivalent:
undefined

Blockly.C['serial_read_bytes_until']()

Code Equivalent:
undefined

serial_available()


Returns the number of bytes available for reading from the serial port.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
Serial.available()

serial_available_write()


Returns the number of bytes available for writing in the serial buffer without blocking the write operation.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
Serial.availableForWrite()

serial_begin(value_speed)


Starts serial operations at the given bits per second.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
value_speed

the number of bits per second to read serial at

Code Equivalent:
Serial.begin(value_speed);

serial_end()

Code Equivalent:
Serial.end();

serial_find(target)


Searches for the target message in the serial buffer and returns true or false based on if it's found before timing out.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
target

the message to search for in the serial buffer

Code Equivalent:
Serial.find(target)

serial_find_until(target, terminal)


Reads data from the serial buffer until it finds the target or terminator string. Returns true if the target string is found, or false if it times out.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
target

the string to search for to return true

terminal

the terminator string to search for

Code Equivalent:
Serial.find(target, terminal)

serial_flush()


Waits for the transmission of outgoing serial data to complete.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
Serial.flush();

serial_parse_float()


Returns the next valid float in the incoming serial message.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
Serial.parseFloat()

serial_parse_int()


Returns the next valid integer in the incoming serial message.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
Serial.parseInt()

serial_peek()


Returns the next byte of incoming serial data without removing it from the buffer.

Check out the third party documentation for a more in depth explanation.

Code Equivalent:
Serial.peek()

serial_print(value_output)


Prints messages to the serial output with no new line at the end.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
value_output

the message to print

Code Equivalent:
Serial.print(value_output);

serial_print_line(value_output)


Prints messages to the serial output with a new line at the end.

Check out the third party documentation for a more in depth explanation.

Parameters:
Name Type Description
value_output

the message to print

Code Equivalent:
Serial.println(value_output);

serial_read()

Code Equivalent:
Serial.read()

serial_set_timeout()

Code Equivalent:
Serial.setTimeout(milliseconds);