-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwriteOutParameterFrame.ino
More file actions
31 lines (28 loc) · 1.52 KB
/
Copy pathwriteOutParameterFrame.ino
File metadata and controls
31 lines (28 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// ────────────────────────────────────────────────────────────────────
// writeOutParameterFrame.ino « reply to EXPgetParameter_return »
// ────────────────────────────────────────────────────────────────────
// Emits one >>...<< frame summarising the firmware's current state.
// Parsed on the host side by cuewire.shinto.parse_exp_parameters.
//
// Frame fields, in order:
// preStimDur, pulseDur, IPI, ITI,
// preTemplateDur, templateStepDur, templateIPI, templateITI,
// templateRep, sysMod, experimentRunning
void writeOutParameterFrame() {
bool oldWriteOutFlag = writeOutFlag;
writeOutFlag = false;
Serial.print(">>");
Serial.print(preStimDur); Serial.print(",");
Serial.print(pulseDur); Serial.print(",");
Serial.print(IPI); Serial.print(",");
Serial.print(ITI); Serial.print(",");
Serial.print(preTemplateDur); Serial.print(",");
Serial.print(templateStepDur); Serial.print(",");
Serial.print(templateIPI); Serial.print(",");
Serial.print(templateITI); Serial.print(",");
Serial.print(templateRep); Serial.print(",");
Serial.print(sysMod); Serial.print(",");
Serial.print(experimentRunning ? 1 : 0);
Serial.println("<<");
writeOutFlag = oldWriteOutFlag;
}