Skip to content

Commit

Permalink
Update hardware.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Oct 31, 2023
1 parent 0bb4dc9 commit f13ea04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions iblrig/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,12 @@ def set_status_led(self, state: bool) -> bool:
log.info(f'{"en" if state else "dis"}abling Bpod Status LED')
command = struct.pack("cB", b":", state)
self._arcom.serial_object.write(command)
return self._arcom.serial_object.read(1)
if self._arcom.read_uint8() == 1:
return True
except serial.SerialException:
self._arcom.serial_object.flush()
log.error('Bpod device does not support control of the status LED. Please update firmware.')
self.set_status_led.supported = False
self.set_status_led.supported = False
return False

def valve(self, valve_id: int, state: bool):
Expand Down

0 comments on commit f13ea04

Please sign in to comment.