Skip to content

Commit

Permalink
BF: iohub PstBox P3 compat
Browse files Browse the repository at this point in the history
- needs testing / verificatiuon.
  • Loading branch information
isolver authored and peircej committed Oct 7, 2019
1 parent d115e63 commit da83429
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion psychopy/iohub/devices/serial/__init__.py
Expand Up @@ -5,6 +5,7 @@
import serial
import sys
import numpy as N
import struct
from ... import EXP_SCRIPT_DIRECTORY
from .. import Device, DeviceEvent, Computer
from ...errors import print2err, printExceptionDetailsToStdErr
Expand Down Expand Up @@ -546,7 +547,7 @@ def _update_state(self):
# Convert the new state into a bitmask, collapse it into a
# single byte and send it to the response box.
state_bits = (2**N.arange(8))[state]
self.write(chr(N.sum(state_bits)))
self.write(struct.pack("B",(N.sum(state_bits))))

# Set the `update lamp` bit to LOW again.
state[6] = False
Expand Down

0 comments on commit da83429

Please sign in to comment.