fast-feedback virtual target task code on STM Nucleo

Dependencies:   mbed

Committer:
gwappa
Date:
Sat Jul 21 00:36:38 2018 +0000
Revision:
27:b31ea8d74f9e
Parent:
26:b4421d1ee57a
Child:
28:797536a42b9f
add scheduler in order to fix the zero-latency bug

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gwappa 3:991c6d5ce19d 1 #include "rig.h"
gwappa 11:897ecd5413e0 2 #include "utils.h"
gwappa 26:b4421d1ee57a 3 #include "arduinopins.h"
gwappa 3:991c6d5ce19d 4
gwappa 3:991c6d5ce19d 5 // the task timer
gwappa 3:991c6d5ce19d 6 Timer timer;
gwappa 3:991c6d5ce19d 7
gwappa 3:991c6d5ce19d 8 // input
gwappa 26:b4421d1ee57a 9 InterruptHandler gateIn(ARDUINO_11);
gwappa 26:b4421d1ee57a 10 InterruptHandler whiskIn(ARDUINO_12); // or USER_BUTTON
gwappa 26:b4421d1ee57a 11 InterruptHandler lickIn(ARDUINO_13); // or USER_BUTTON
gwappa 3:991c6d5ce19d 12
gwappa 3:991c6d5ce19d 13 // output
gwappa 27:b31ea8d74f9e 14 Pulse audioOut(ARDUINO_10); // or LED1
gwappa 12:06ea96546af1 15 Pulse visualOut(ARDUINO_A1); //
gwappa 12:06ea96546af1 16 Pulse rewardOut(ARDUINO_A2); //
gwappa 9:e136394bdb39 17
gwappa 12:06ea96546af1 18 Pulse trialStart(ARDUINO_A3, ms_to_us(TRIGGER_DUR_MS)); // or any other pin
gwappa 12:06ea96546af1 19 Pulse trialEnd(ARDUINO_A4, ms_to_us(TRIGGER_DUR_MS)); //
gwappa 3:991c6d5ce19d 20
gwappa 3:991c6d5ce19d 21 Task task(Pair);
gwappa 3:991c6d5ce19d 22 Trial trial;