Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
ButtonBoxes
(view source)
Revision as of 16:54, 29 April 2015
110 bytes added
,
16:54, 29 April 2015
→Python/PsychoPy
Line 175:
Line 175:
Example using buttons from the buttonbox in Python:
Example using buttons from the buttonbox in Python:
−
<
nowiki
>
+
<
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)) </
nowiki
>
+
print("b: {}".format(b))
+
</
syntaxhighlight
>
Example using markers with the buttonbox in Python:
Example using markers with the buttonbox in Python:
−
<
nowiki
>
+
<
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 </
nowiki
>
+
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:
−
<
nowiki
>
+
<
syntaxhighlight lang="python" line
>
#!/usr/bin/env python
#!/usr/bin/env python
Line 231:
Line 233:
## Cleanup Section
## Cleanup Section
−
core.quit() </
nowiki
>
+
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
E.vandenberge
Bureaucrats
,
Administrators
1,340
edits
Navigation menu
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Help
About
About the TSG
About this Wiki
FAQ
Disclaimer
Survey
Customer Survey
Tools
Special pages
Printable version