ButtonBox: Difference between revisions
Jump to navigation
Jump to search
| Line 175: | Line 175: | ||
Example using buttons from the buttonbox in Python: | Example using buttons from the buttonbox in Python: | ||
<syntaxhighlight lang="python" line> | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
| Line 188: | Line 188: | ||
# print the button pressed | # print the button pressed | ||
print("b: {}".format(b)) </ | print("b: {}".format(b)) | ||
</syntaxhighlight> | |||
Example using markers with the buttonbox in Python: | Example using markers with the buttonbox in Python: | ||
<syntaxhighlight lang="python" line> | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
| Line 202: | Line 203: | ||
# wait for a single button press | # wait for a single button press | ||
bb.sendMarker(val=100) #This is your marker code, range code 1-255 </ | bb.sendMarker(val=100) #This is your marker code, range code 1-255 | ||
</syntaxhighlight> | |||
<br/>Example using the Buttonbox in PsychoPy: | <br/>Example using the Buttonbox in PsychoPy: | ||
<syntaxhighlight lang="python" line> | |||
#!/usr/bin/env python | #!/usr/bin/env python | ||
| Line 231: | Line 233: | ||
## Cleanup Section | ## Cleanup Section | ||
core.quit() </ | core.quit() | ||
</syntaxhighlight> | |||
For more documentation click here: http://pythonhosted.org//RuSocSci/index.html | For more documentation click here: http://pythonhosted.org//RuSocSci/index.html | ||