PHP code example of ignacioxd / pupil-remote-php

1. Go to this page and download the library: Download ignacioxd/pupil-remote-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ignacioxd / pupil-remote-php example snippets


$host = "127.0.0.1";
$port = 50020;
$remote = new \Ignacioxd\PupilRemote();
$remote->connect($host, $port); // Or leave empty for defaults

$pupilTime = $remote->getTimebase();

$remote->setTimebase(123.456);

if( $remote->startCalibration() ) {
  echo "Calibration started";
}

if( $remote->stopCalibration() ) {
  echo "Calibration stopped";
}

if( $remote->startRecording() ) {
  echo "Recording started";
}

if( $remote->stopRecording() ) {
  echo "Recording stopped";
}
shell
composer