Arduino

class labequipment.arduino.Arduino(port=None, rate=9600, wait=True)

Bases: object

choose_port(os='linux')
flush()
ignorelines(n)
quit_serial()

Close the serial port

read_all()
read_serial_bytes(no_of_bytes)

Read a given no_of_bytes from the serial port

read_serial_line()

Waits for data in the input buffer then reads a single line from the serial port.

Outputs:
text the data from serial in unicode
readlines(n)
send_serial_line(text)

Send a string over the serial port making sure it ends in a new line .

Input:
text the string to be sent to the arduino
wait_for_ready()

Ensure the arduino has initialised by waiting for the ‘ready’ command

labequipment.arduino.find_port()