Keisuke Sehara
/
STM32_Whisking
fast-feedback virtual target task code on STM Nucleo
rig.cpp@9:e136394bdb39, 2018-06-18 (annotated)
- Committer:
- gwappa
- Date:
- Mon Jun 18 10:43:45 2018 +0000
- Revision:
- 9:e136394bdb39
- Parent:
- 8:973dcd190672
- Child:
- 11:897ecd5413e0
add WithCue mode in place of Pair
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gwappa | 3:991c6d5ce19d | 1 | #include "rig.h" |
gwappa | 3:991c6d5ce19d | 2 | |
gwappa | 3:991c6d5ce19d | 3 | // the task timer |
gwappa | 3:991c6d5ce19d | 4 | Timer timer; |
gwappa | 3:991c6d5ce19d | 5 | |
gwappa | 3:991c6d5ce19d | 6 | // state time out |
gwappa | 3:991c6d5ce19d | 7 | Timeout stateTimeout; |
gwappa | 3:991c6d5ce19d | 8 | |
gwappa | 3:991c6d5ce19d | 9 | // reward time out |
gwappa | 3:991c6d5ce19d | 10 | Timeout rewardTimeout; |
gwappa | 3:991c6d5ce19d | 11 | |
gwappa | 9:e136394bdb39 | 12 | // trigger time out for TASK output |
gwappa | 9:e136394bdb39 | 13 | Timeout triggerTimeout; |
gwappa | 9:e136394bdb39 | 14 | |
gwappa | 3:991c6d5ce19d | 15 | // input |
gwappa | 8:973dcd190672 | 16 | InterruptIn whiskIn(PC_0); // (Arduino#A5) or USER_BUTTON |
gwappa | 8:973dcd190672 | 17 | InterruptIn lickIn(PC_1); // (Arduino#A4) or USER_BUTTON |
gwappa | 3:991c6d5ce19d | 18 | |
gwappa | 3:991c6d5ce19d | 19 | // output |
gwappa | 9:e136394bdb39 | 20 | DigitalOut cueOut(PA_4); // (Arduino#A3) or LED1 |
gwappa | 9:e136394bdb39 | 21 | DigitalOut rewardOut(PA_1); // (Arduino#A2) |
gwappa | 9:e136394bdb39 | 22 | DigitalOut enableOut(PA_0); // (Arduino#A1) |
gwappa | 9:e136394bdb39 | 23 | |
gwappa | 9:e136394bdb39 | 24 | DigitalOut trialStart(PA_5); // (Arduino#13) or any other pin |
gwappa | 9:e136394bdb39 | 25 | DigitalOut trialEnd(PA_6); // (Arduino#12) |
gwappa | 3:991c6d5ce19d | 26 | |
gwappa | 3:991c6d5ce19d | 27 | Task task(Pair); |
gwappa | 3:991c6d5ce19d | 28 | Trial trial; |