Skip to content

Commit

Permalink
Fix a bug in Serial Communication
Browse files Browse the repository at this point in the history
  • Loading branch information
platini2 authored Dec 12, 2020
1 parent d49ce2f commit d442027
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion celestron.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,18 @@ def transmitmsg(receiver,command):
data = sendmsg(receiver,command)
if connmode == 'wifi':
sock.send(data)
if connmode == 'serial' or connmode=='hc':
if connmode == 'serial':
ser.rtscts = True
ser.rts=True
ser.write(data)
ser.rts=False
ser.rts=True
ser.rts=False
time.sleep(.1)
ser.read(ser.inWaiting())
ser.rtscts = False
if connmode == 'hc':
ser.write(data)
time.sleep(0.25)

def keep_alive(interval):
Expand Down

0 comments on commit d442027

Please sign in to comment.