def __init__(self, *args, **kwargs): MainWindowBase.__init__(self, *args, **kwargs) self.Bind(wx.EVT_CLOSE, self.on_close, self) self.set_connected(False) timer_id = 100 self.update_timer = wx.Timer(self, timer_id) wx.EVT_TIMER(self, timer_id, self.on_timer) self.update_timer.Start(1000)
def __init__(self, *args, **kwargs): MainWindowBase.__init__(self, *args, **kwargs) self.arduino = None # Load the serial port name try: serial_port = open("serial_port.conf", "r").read() except IOError: serial_port = "" self.serial_port.ChangeValue(serial_port) # Connect to the arduino try: self.connect() except: pass # Oh well... self._last_connected = 0