Flip?

Hey all

I'm new to both psychtoolbox and matlab and am having a bit of trouble
with the Screen('flip') function
I want to display a stimulus for 2 seconds, then display another
stimulus until a key is pressed

I roughly understand what flip does, but not really how to use it

Screen(wPtr, 'Flip', [,when])

I have tried using "when" in various ways but all of my attempts give
error messages like this:

PTB-ERROR: Screen('Flip'); beamposition timestamping computed an
*impossible stimulus onset value* of 175915.677139 secs, which would
indicate that
PTB-ERROR: stimulus onset happened *before* it was actually requested!
(Earliest theoretically possible 175915.687888 secs).


Any advice would be most welcome!

Cheers,

Claire
--- In psychtoolbox@yahoogroups.com, "claire.chambers@..." <cchamber@...> wrote:
>
> Hey all
>
> I'm new to both psychtoolbox and matlab and am having a bit of trouble
> with the Screen('flip') function
> I want to display a stimulus for 2 seconds, then display another
> stimulus until a key is pressed
>
> I roughly understand what flip does, but not really how to use it
>
> Screen(wPtr, 'Flip', [,when])
>
> I have tried using "when" in various ways but all of my attempts give
> error messages like this:
>
> PTB-ERROR: Screen('Flip'); beamposition timestamping computed an
> *impossible stimulus onset value* of 175915.677139 secs, which would
> indicate that
> PTB-ERROR: stimulus onset happened *before* it was actually requested!
> (Earliest theoretically possible 175915.687888 secs).



Hey, when you specify the "when" timestamp you should use "absolute" times. The thing
about absolute times is that they are in seconds elapsed since some Epoch. In Linux, time
zero is January 1, 1970. In Windows T_0 is, I think, the time of starting the computer.
Unsure about OSX.

The simple way to use relative times is of course to take a difference every time you want
to wait, say, two seconds.

now = GetSecs()
Screen('Flip', w, now+2 )

So the flip will be made exactly 2 seconds later. GetSecs gives you an absolute timestamp
and you add two seconds. You can obtain absolute timestamps from many commands, like
Screen('Flip') itself!

time_of_flip1 = Screen('Flip', w )
% this screen now remains on screen for exactly two seconds
timeofflip2 = Screen('Flip', w, time_of_flip1 + 2 )
% timeofflip2 is the exact absolute time since epoch when the stim appeared.