Skip to content

Commit

Permalink
Update pyserial commands as part of fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgee committed Jun 30, 2019
1 parent 45d911a commit 7ed1754
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/peas-shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def do_turn_off_relay(self, *arg):
relay_info = relay_lookup[relay]
serial_connection = self.environment.serial_readers[relay_info['board']]['reader']

serial_connection.ser.flushInput()
serial_connection.ser.reset_input_buffer()
serial_connection.write("{},0\n".format(relay_info['pin']))
except Exception as e:
print_warning("Problem turning relay off {}".format(relay))
Expand All @@ -212,7 +212,7 @@ def do_turn_on_relay(self, *arg):
relay_info = relay_lookup[relay]
serial_connection = self.environment.serial_readers[relay_info['board']]['reader']

serial_connection.ser.flushInput()
serial_connection.ser.reset_input_buffer()
serial_connection.write("{},1\n".format(relay_info['pin']))
except Exception as e:
print_warning("Problem turning relay on {}".format(relay))
Expand Down

0 comments on commit 7ed1754

Please sign in to comment.