You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ersp-plot.lua 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. g_sent = false
  2. g_numTrials = 10
  3. function initialize(box)
  4. dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua")
  5. -- make sure we get equal number of both trials
  6. g_numTrials = 2 * box:get_setting(2)
  7. g_sent = false;
  8. end
  9. function uninitialize(box)
  10. end
  11. function process(box)
  12. while box:keep_processing() and g_sent == false do
  13. box:send_stimulation(1, OVTK_StimulationId_ExperimentStart, 0, 0)
  14. current_time = 5
  15. for i = 1 , g_numTrials do
  16. if i % 2 == 0 then
  17. box:send_stimulation(1, OVTK_GDF_Left, current_time+0, 0)
  18. else
  19. box:send_stimulation(1, OVTK_GDF_Right, current_time+0, 0)
  20. end
  21. box:send_stimulation(1, OVTK_StimulationId_Label_01, current_time+1, 0)
  22. box:send_stimulation(1, OVTK_StimulationId_Label_00, current_time+2, 0)
  23. box:send_stimulation(1, OVTK_StimulationId_Label_01, current_time+3, 0)
  24. box:send_stimulation(1, OVTK_StimulationId_Label_00, current_time+4, 0)
  25. box:send_stimulation(1, OVTK_StimulationId_RestStart, current_time+5, 0)
  26. current_time = current_time + 10
  27. end
  28. box:send_stimulation(1, OVTK_StimulationId_ExperimentStop, current_time, 0)
  29. box:send_stimulation(1, OVTK_StimulationId_EndOfFile, current_time+2, 0)
  30. g_sent = true
  31. box:sleep()
  32. end
  33. end