{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "50cf10aa",
   "metadata": {},
   "source": [
    "# Event marker synchronization\n",
    "\n",
    "    Stimuli delivery > Event synchonization\n",
    "\n",
    "Is possible to take advantage of the OpenBCI construction, this board includes a set of analog and digital inputs that can be used to synchronize markers. Other systems will need a piece of additional laboratory equipment like [LabStreamer](https://www.neurobs.com/menu_presentation/menu_hardware/labstreamer) that can register time with microseconds precision. In order to use OpenBCI, we will only need an _LDR module_ connected to the pin **D11** (or **A5**) and start the automatic latency correction system. This method is similar to the one implemented by <cite data-footcite=\"davis2020stimulus\">davis2020stimulus</cite>."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1a45ca7b",
   "metadata": {},
   "source": [
    "<img src='images/marker_sync.gif'></img>"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0373656d",
   "metadata": {},
   "source": [
    "This simple latency correction consists of a stimuli delivery with only a marker synchronization area, the _LDR module_ is constantly sensing (the [boardmode](02-interface.ipynb#Connection) must be in `analog`) so the changes on the square signal are compared with streamed markers and then the latency is corrected. The latency correction **only affects the current session**, if the framework is restarted this calibration will lose. \n",
    "\n",
    "For hard event synchronization, is prefer to use [the markers synchronization constantly](80-stimuli_delivery.ipynb#Hardware-based-event-synchonization) during all run."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0fb124b3",
   "metadata": {},
   "source": [
    "---\n",
    ".. footbibliography::"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
