Rev 706 | Rev 716 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 706 | Rev 708 | ||
---|---|---|---|
Line 252... | Line 252... | ||
252 | msg = MkMsg(address=0, cmd='d', data=[500]) |
252 | msg = MkMsg(address=0, cmd='d', data=[500]) |
253 | self.getDebugMsgLn = msg.generateUartLine() |
253 | self.getDebugMsgLn = msg.generateUartLine() |
Line 254... | Line 254... | ||
254 | 254 | ||
255 | 255 | ||
256 | def open(self, comPort): |
256 | def open(self, comPort): |
257 | self.serPort = serial.Serial(comPort, 57600, timeout=0.5) |
257 | self.serPort = serial.Serial(comPort, 57600, timeout=0.5, rtscts=1) |
Line 258... | Line 258... | ||
258 | if not self.serPort.isOpen(): |
258 | if not self.serPort.isOpen(): |
259 | raise IOError("Failed to open serial port") |
259 | raise IOError("Failed to open serial port") |
Line 360... | Line 360... | ||
360 | 360 | ||
361 | if __name__ == '__main__': |
361 | if __name__ == '__main__': |
362 | try: |
362 | try: |
363 | comm = MkComm() |
363 | comm = MkComm() |
364 | comm.printDebugMsg = True |
364 | comm.printDebugMsg = True |
Line 365... | Line 365... | ||
365 | comm.open(comPort="COM5") |
365 | comm.open(comPort="COM40") |
366 | 366 | ||
Line 367... | Line 367... | ||
367 | msg = comm.getVersionMsg() |
367 | msg = comm.getVersionMsg() |