Serial Communication Between Arduino And Python
On

Arduino Usb Communication
Import serialimport time # Required to use delay functions# Create Serial port object called arduinoSerialDataarduinoSerialData = serial.Serial('com14', 9600)time.sleep(2) # wait for 2 secounds for the communication to get establishedprint arduinoSerialData.readline # read the serial data and print it as lineprint ('Enter 1 to turn ON LED and 0 to turn OFF LED')while 1: # Do this forevervar = rawinput # get input from userprint 'you entered', var # print the intput for confirmationarduinoSerialData.write(var)Mod edit: added code tags code /code=.