Skip to content

Commit

Permalink
added a short script to test the touchscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
chrplr committed Nov 19, 2019
1 parent ae9df06 commit 0878e1c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Binary file added examples/no2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions examples/touchscreen-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#! /usr/bin/env python
# Time-stamp: <2019-11-19 13:02:26 christophe@pallier.org>

""" Touchscreen test """

import expyriment

NTRIALS = 5

exp = expyriment.design.Experiment(name="sentence picture matching task") # create an Experiment object
expyriment.control.set_develop_mode(on=True) ## Set develop mode. Comment for real experiment

expyriment.control.initialize(exp)

img1 = expyriment.stimuli.Picture("no2.jpg", position=(-200, 100)) # NO
img2 = expyriment.stimuli.Picture("yes2.jpg", position=(200, 100)) # YES

BB = expyriment.io.TouchScreenButtonBox([img1, img2])
BB.create()

exp.add_data_variable_names(['resonse', 'rt'])

expyriment.control.start()

for i in range(NTRIALS):
BB.show()
img, resptime = BB.wait()

exp.data.add(["No" if img == img1 else "Yes" , resptime])

exp.screen.clear()
exp.screen.update()

exp.clock.wait(2000)

expyriment.control.end()
Binary file added examples/yes2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0878e1c

Please sign in to comment.