// Use this for initialization void Start() { //TODO: OPEN USB mySyncbox = new ThreadedSyncbox(); mySyncbox.Start(); }
// Update is called once per frame void Update() { if (mySyncbox != null) { //TESTING STIMULATION TIMING if (Input.GetKeyDown(KeyCode.S)) { UnityEngine.Debug.Log("Starting stim!"); StartStim(10, 3); //10MS pulse every second for 3 seconds } if (Input.GetKeyDown(KeyCode.A)) { UnityEngine.Debug.Log("Starting sync!"); StartSync(10, 10); //TODO: get rid of duty cycle? make it always out of one second? } if (mySyncbox.Update()) //update returns true when it's finished! // Alternative to the OnFinished callback { mySyncbox = null; } } }