Function serial::construct()

← Back to Class serial



Module serialClass serial → construct()

Description

The constructor. Create an instance of class serial and open the port

serial::construct(port, timeout = 30000, baudrate = 9600, bytesize = 8, parity = parity_none, stopbits = stopbits_one, flowcontrol = flowcontrol_none)


Parameters


Return Value


Usage Example

import serial
 
arduino = serial("/dev/ttyACM0")
 
if arduino.is_open()
    arduino.write("Hello")
    arduino.close()
endif