 
      
      serial::read()Read a given amount of bytes from the serial port and then return a string containing the data
serial::read(total_bytes)
total_bytes (number)  — How many bytes to be read
string — Returns the string containing the data
import serial
 
arduino = serial("/dev/ttyACM0")
 
if !arduino.is_open()
    exit(arduino.get_error())
endif
 
data = arduino.read(8)
writeln(data)
 
arduino.close()