Apr-12-2017, 07:41 AM
I'm using COM32 (it's an Arduino). I found some code on https://petrimaki.com/2013/04/28/reading...windows-7/ which I can't get to work either:
NameError: name 'ser' is not defined"
import serial import time ser = serial.Serial('COM32', 9600, timeout=0) while 1: try: print ser.readline() time.sleep(1) except ser.SerialTimeoutException: print('Data could not be read') time.sleep(1)First I get a syntax error in the print statement, because parentheses are lacking, so I add those. Then I get the error "serin = ser.read()
NameError: name 'ser' is not defined"