JGuizard
8/9/2017 - 3:56 PM

Communicate with an Arduino thought the serial port

Communicate with an Arduino thought the serial port

/*READ*/
import serial
ser = serial.Serial('/dev/tty.usbserial', 9600)
while 1:
  ser.readline()
  '1 Hello world!\r\n'
  '2 Hello world!\r\n'
  '3 Hello world!\r\n'

/*WRITE*/
import serial # if you have not already done so
ser = serial.Serial('/dev/tty.usbserial', 9600)
ser.write('5')