Unable to get arduino serial communication working in wxpython GUI
问题 This is the definition which is used to update the labels in the GUI: def updateV(self, event): """""" global v ser = serial.Serial( port='COM3', baudrate=9600) x = ser.read() # read one byte ser.close() print x if v>3: self.labelOne.SetBackgroundColour('red') self.labelOne.SetLabel('Battery Voltage : ' + x) else: self.labelOne.SetBackgroundColour('white') self.labelOne.SetLabel('Battery Voltage : ' + str(v)) self.Refresh() This is the simple arduino code i have been using: int a; void setup(