| opiPresent_for_Compass {OPI} | R Documentation | 
Implementation of opiPresent for the Compass machine.
Description
This is for internal use only. Use opiSetup() with
these Arguments and you will get the Value back.
Arguments
stim | 
 A list of stimulus parameters (see Details).  | 
nextStim | 
 Unused - included for compliance with OPI standard.  | 
Details
If the chosen OPI implementation is Compass, then nextStim
is ignored. Note that the dB level is rounded to the nearest integer.
If tracking is on, then this will block until the tracking is obtained, and the stimulus presented.
stim is a list containing some or all of the following elements:
-  
x, x-coordinate in degrees (floating point) (range $[-30,30]$). -  
y, y-coordinate in degrees (floating point) (range $[-30,30]$). -  
levelis luminance in cd/\mbox{m}^2, and is rounded to the nearest whole dB for display (range 0 to 50). 0dB is 10000aps. -  
responseWindowis in milliseconds (range 0 to 2680). 
Stimulus duration is assumed to be 200ms, and size is assumed to be Goldmann III (0.43 degrees diameter), color is assumed to be white. These cannot be changed.
Value
A list containing:
-  
err0 all clear, >= 1 some error codes (eg cannot track, etc) (integer) -  
seenFALSEfor not seen,TRUEfor seen (button pressed in response window) -  
timeResponse time in ms (integer) since stimulus onset, -1 for not seen -  
time_recTime since epoch when command was received at Compass (integer ms) -  
time_presTime since epoch that stimulus was presented (integer ms) -  
num_track_eventsNumber of tracking events that occurred during presentation (integer) -  
num_motor_failsNumber of times motor could not follow fixation movement during presentation (integer) -  
pupil_diamPupil diameter in mm (float) -  
loc_xPixels integer, location in image of presentation (integer) -  
loc_yPixels integer, location in image of presentation (integer) 
Examples
## Not run: 
  # Set up the Compass
  chooseOpi("Compass")
  result <- opiInitialize(ip = "192.168.1.7", port = 44965)
  if (!is.null(result$err))
    stop("Initialisation failed")
   #' @param x X location of stim in degrees
   #' @param y Y location of stim in degrees
   #' @param size If 3, Goldmann III, else V
   #' @param db Value in dB
   #' @return stim object ready for opiPresent
   makeStim <- function(x, y, size, db) {
       s <- list(x = x, y = y, level = dbTocd(db, 10000 / pi),
           size = ifelse(size == 3, 0.43, 1.77),
           duration = 200, responseWindow = 1500)
       class(s) <- "opiStaticStimulus"
       return(s)
   }
   result <- opiPresent(makeStim(9, 9, 3, 10))
## End(Not run)