Skip to content

Commit

Permalink
RF: Do device setup for BBTK Button Box in setupDevices
Browse files Browse the repository at this point in the history
  • Loading branch information
TEParsons committed Nov 22, 2023
1 parent e16447b commit 4e78268
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions psychopy_bbtk/components/tpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ def addRequirements(self):
importFrom="psychopy_bbtk"
)

def writeInitCode(self, buff):
def writeDeviceCode(self, buff):
# get inits
inits = getInitVals(self.params)
# make Keyboard object
# make ButtonGroup object
code = (
"%(name)s = tpad.TPadButtonGroup(\n"
" %(serialPort)s,\n"
" channels=%(nButtons)s\n"
"deviceManager.addDevice(\n"
" deviceClass='psychopy_bbtk.tpad.TPadButtonGroup',\n"
" deviceName=%(deviceName)s,\n"
" pad=%(serialPort)s,\n"
" channels=%(nButtons)s,\n"
")\n"
)
buff.writeIndentedLines(code % inits)
buff.writeOnceIndentedLines(code % inits)

0 comments on commit 4e78268

Please sign in to comment.