-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdescription.html
More file actions
693 lines (649 loc) · 29.3 KB
/
description.html
File metadata and controls
693 lines (649 loc) · 29.3 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Behaviour Box — behaviour_box 0 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Install" href="Installation.html" />
<link rel="prev" title="Welcome to behaviour_box’s documentation!" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body role="document">
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="behaviour-box">
<h1>Behaviour Box<a class="headerlink" href="#behaviour-box" title="Permalink to this headline">¶</a></h1>
<p><code class="docutils literal"><span class="pre">Version</span> <span class="pre">3.0.20170201.8</span></code></p>
<p>This repository contains a set of files to implement a Go-No-Go task
using an Arduino and Python 2.7. By itself this collects some summary
information for a behavioural trial, but is not a stand alone
implementation. In addition to what is recorded here, I record the
signal direct from the lick sensor using
<a class="reference external" href="https://github.com/JaneliaSciComp/Wavesurfer">Wavesurfer</a>.</p>
<p>The two components to this implementation are the Arduino code, found in
<code class="docutils literal"><span class="pre">./behaviourbox/behaviourbox.ino</span></code> and a Python wrapper for
communicating with this code <code class="docutils literal"><span class="pre">./SerialControl.py</span></code>.</p>
<p>Note: <em>The python wrapper is not written in a cross platform way, it
relies on specific bindings for windows keyboard events.</em></p>
<p>The behaviour box program is now split into a handful of modules. Each
module is mostly holding utility functions for the box as a whole. The
<code class="docutils literal"><span class="pre">behaviourbox.ino</span></code> itself only contains <code class="docutils literal"><span class="pre">setup</span></code> and <code class="docutils literal"><span class="pre">loop</span></code>
functions, which call the other components as necessary.</p>
<div class="section" id="software">
<h2>Software<a class="headerlink" href="#software" title="Permalink to this headline">¶</a></h2>
<div class="section" id="behaviourbox-ino">
<h3>behaviourbox.ino<a class="headerlink" href="#behaviourbox-ino" title="Permalink to this headline">¶</a></h3>
<p>This program delivers sensory stimulation and opens water valve when the
animal touches the licking sensor within a certain time window.</p>
<div class="section" id="requirements">
<h4>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline">¶</a></h4>
</div>
</div>
<div class="section" id="setup-connections">
<h3>Setup connections:<a class="headerlink" href="#setup-connections" title="Permalink to this headline">¶</a></h3>
<p>Table: Analog connections to lick controller</p>
</div>
<div class="section" id="global-variables">
<h3>Global Variables<a class="headerlink" href="#global-variables" title="Permalink to this headline">¶</a></h3>
<table border="1" class="docutils">
<colgroup>
<col width="12%" />
<col width="10%" />
<col width="78%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Variable
Name</th>
<th class="head">pin</th>
<th class="head">Physical connection</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>recTrig</td>
<td><code class="docutils literal"><span class="pre">3</span></code></td>
<td>short recording trigger (10ms TTL pulse )</td>
</tr>
<tr class="row-odd"><td>bulbTrig</td>
<td><code class="docutils literal"><span class="pre">4</span></code></td>
<td>full trial duration signal (bulb style trigger)</td>
</tr>
<tr class="row-even"><td>stimulus
Pin</td>
<td><code class="docutils literal"><span class="pre">5</span></code></td>
<td>Connect to Stimulus device, outputs a variable duration pulse</td>
</tr>
<tr class="row-odd"><td>buzzer
Pin</td>
<td><code class="docutils literal"><span class="pre">6</span></code></td>
<td>Connect to punishment device, (TTL trigger)</td>
</tr>
<tr class="row-even"><td>speaker
Pin</td>
<td><code class="docutils literal"><span class="pre">7</span></code></td>
<td>output to auditory cue speaker</td>
</tr>
<tr class="row-odd"><td>water
Port</td>
<td><code class="docutils literal"><span class="pre">10</span></code></td>
<td>Connect to water valve power supply</td>
</tr>
<tr class="row-even"><td>lick
Sensor</td>
<td><code class="docutils literal"><span class="pre">A0</span></code></td>
<td>The Piezo Amplifier is connected to the analog input</td>
</tr>
</tbody>
</table>
<p>Table: connections</p>
</div>
<div class="section" id="files">
<h3>Files<a class="headerlink" href="#files" title="Permalink to this headline">¶</a></h3>
<p>The header files in the behaviourbox folder contain the functions
required to run the behaviourbox code. There are currently 7 header
files:</p>
<blockquote>
<div><ol class="arabic simple">
<li><code class="docutils literal"><span class="pre">global_variables.h</span></code></li>
<li><code class="docutils literal"><span class="pre">prototypes.h</span></code></li>
<li><code class="docutils literal"><span class="pre">timing.h</span></code></li>
<li><code class="docutils literal"><span class="pre">sensors.h</span></code></li>
<li><code class="docutils literal"><span class="pre">states.h</span></code></li>
<li><code class="docutils literal"><span class="pre">SerialComms.h</span></code></li>
<li><code class="docutils literal"><span class="pre">single_port_setup.h</span></code></li>
</ol>
</div></blockquote>
<div class="section" id="global-variables-h">
<h4>global_variables.h<a class="headerlink" href="#global-variables-h" title="Permalink to this headline">¶</a></h4>
<p>contains definitions of all variables that are used by multiple
functions and expected to have persistent values between the functions.
These include the initialisation time, the various timing parameters, as
well as any additional options that I have decided to make available.</p>
<table border="1" class="docutils">
<colgroup>
<col width="43%" />
<col width="57%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">variable</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>t_init</td>
<td>not settable. This is
the variable that the
other times a measured
relative to</td>
</tr>
<tr class="row-odd"><td>t_noLickPer</td>
<td>A time measured in
milliseconds. After
this amount of time
the program will break
out of a trial if a
lick is detected
before the stimulus.
If the value is 0 then
licks before the
stimulus are ignored
altogether.</td>
</tr>
<tr class="row-even"><td>trial_delay</td>
<td>Amount of time in
milliseconds to delay
the start of a trial</td>
</tr>
<tr class="row-odd"><td>t_rewardDEL</td>
<td>Amount of time in
milliseconds to delay
checking for licks
after a stimulus</td>
</tr>
<tr class="row-even"><td>t_rewardDUR</td>
<td>Amount of time in
milliseconds to check
for licks</td>
</tr>
<tr class="row-odd"><td>t_trialDUR</td>
<td>Total time in
milliseconds that the
trial should last</td>
</tr>
<tr class="row-even"><td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>t_stimONSET</td>
<td>The time in
milliseconds, relative
to the trial start
time, that the
stimulus turns on</td>
</tr>
<tr class="row-even"><td>t_stimDUR</td>
<td>Amount of time in
milliseconds to keep
the stimulus on</td>
</tr>
<tr class="row-odd"><td> </td>
<td> </td>
</tr>
<tr class="row-even"><td>timeout</td>
<td>Boolean value. If True
enable the recursive
timeout punishment</td>
</tr>
<tr class="row-odd"><td> </td>
<td> </td>
</tr>
<tr class="row-even"><td>debounce</td>
<td>Number of milliseconds
to delay between
reading the lick
sensor value.</td>
</tr>
<tr class="row-odd"><td>lickThres</td>
<td>The threshold on the
licksensor required to
call a lick. This is a
number between 0 -
1024 (multiply by 5
V/1024 to get voltage)</td>
</tr>
<tr class="row-even"><td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>minlickCount</td>
<td>The number of licks
required to count as a
response, ie to open
the water valve, or to
deliver a punishment</td>
</tr>
<tr class="row-even"><td>lickTrigReward</td>
<td>Boolean, set true to
enable the reward to
be delivered
immediatly after the
min licks are reached.
If false the reward is
deliverd at the end of
the response duration</td>
</tr>
<tr class="row-odd"><td>reward_nogo</td>
<td>Boolean, set true if
you want a correct
rejection to be
rewarded at the end on
the reward period</td>
</tr>
<tr class="row-even"><td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>mode</td>
<td>{‘-‘, ‘O’, ‘H’} a
character to represent
the type of mode to
run in. If the mode is
‘H’ the system will
delver a stimulus and
a reward in response
to the animal’s lick.
If the mode is ‘O’ the
system delivers a
stimulus and listens
for a response</td>
</tr>
<tr class="row-even"><td> </td>
<td> </td>
</tr>
<tr class="row-odd"><td>waterVol</td>
<td>Amount of time in
milliseconds to hold
the water valve open
for</td>
</tr>
<tr class="row-even"><td>trialType</td>
<td>character code {‘G’ or
‘N’} to determine if
this is a go or no go
trial. This is used to
determine if the water
valve will open in
response to animal’s
lick</td>
</tr>
<tr class="row-odd"><td> </td>
<td> </td>
</tr>
<tr class="row-even"><td>verbose</td>
<td>Boolean, if True will
enable full debug
printing...(might be
deprecated?)</td>
</tr>
<tr class="row-odd"><td>break_wrongChoi
ce</td>
<td>Boolean, deprecated</td>
</tr>
<tr class="row-even"><td>punish_tone</td>
<td>deprecated</td>
</tr>
<tr class="row-odd"><td>audio</td>
<td>Boolean, enables
auditory cues for the
response period</td>
</tr>
<tr class="row-even"><td> </td>
<td> </td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<hr class="docutils" />
<div class="section" id="serialcontroller-py">
<h2>SerialController.py<a class="headerlink" href="#serialcontroller-py" title="Permalink to this headline">¶</a></h2>
<p>This python script is a wrapper for communicating with the Arduino
program. At it’s heart is a simple loop that reads data transmitted
through a serial connection. This is not a necessary component, however
I wrote it to make running trials a lot easier.</p>
<p>call signature</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">usage</span><span class="p">:</span> <span class="n">SerialControl</span><span class="o">.</span><span class="n">py</span> <span class="p">[</span><span class="o">-</span><span class="n">h</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">af</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">trials</span> <span class="p">[</span><span class="n">TRIALS</span> <span class="p">[</span><span class="n">TRIALS</span> <span class="o">...</span><span class="p">]]]</span>
<span class="p">[</span><span class="o">-</span><span class="n">lt</span> <span class="n">LICKTHRES</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">verbose</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">restore</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">repeats</span> <span class="n">REPEATS</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">port</span> <span class="n">PORT</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">ITI</span> <span class="n">ITI</span> <span class="n">ITI</span><span class="p">]</span>
<span class="p">[</span><span class="o">-</span><span class="n">rdur</span> <span class="n">T_RDUR</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">ltr</span><span class="p">]</span> <span class="p">[</span><span class="o">--</span><span class="n">t_stimONSET</span> <span class="n">T_STIMONSET</span><span class="p">]</span>
<span class="p">[</span><span class="o">--</span><span class="n">datapath</span> <span class="n">DATAPATH</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">i</span> <span class="n">ID</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">m</span> <span class="n">MODE</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">to</span> <span class="n">TIMEOUT</span><span class="p">]</span>
<span class="p">[</span><span class="o">-</span><span class="n">nlp</span> <span class="n">NOLICK</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">w</span> <span class="n">WEIGHT</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">td</span> <span class="n">TRIALDUR</span><span class="p">]</span>
<span class="p">[</span><span class="o">-</span><span class="n">rdel</span> <span class="n">T_RDELAY</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">p</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">noise</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">rng</span><span class="p">]</span> <span class="p">[</span><span class="o">-</span><span class="n">lc</span> <span class="n">LCOUNT</span><span class="p">]</span>
</pre></div>
</div>
<div class="section" id="optional-arguments">
<h3>Optional Arguments:<a class="headerlink" href="#optional-arguments" title="Permalink to this headline">¶</a></h3>
<dl class="data">
<dt id="help">
<code class="descname">help</code><a class="headerlink" href="#help" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-h,</span> <span class="pre">--help</span></code></p>
<p>show this help message and exit</p>
</dd></dl>
<dl class="data">
<dt id="audio">
<code class="descname">audio</code><a class="headerlink" href="#audio" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-af,</span> <span class="pre">--audio</span></code></p>
<p>provides audio feedback during the trials this is not to be confused
with the noise played to simulate / mask the scanners</p>
</dd></dl>
<dl class="data">
<dt id="trials">
<code class="descname">trials</code><a class="headerlink" href="#trials" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--trials</span> <span class="pre">[TRIALS</span> <span class="pre">[TRIALS</span> <span class="pre">...]]</span></code></p>
<p>stimulus durations to run on each trial. That is, the duration of the
stimulus pulse.</p>
</dd></dl>
<dl class="data">
<dt id="lickthres">
<code class="descname">lickthres</code><a class="headerlink" href="#lickthres" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-lt</span> <span class="pre">LICKTHRES,</span> <span class="pre">--lickThres</span> <span class="pre">LICKTHRES</span></code></p>
<p>set <code class="docutils literal"><span class="pre">lickThres</span></code> in arduino</p>
</dd></dl>
<dl class="data">
<dt id="verbose">
<code class="descname">verbose</code><a class="headerlink" href="#verbose" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--verbose</span></code></p>
<p>for debug this will print everything if enabled</p>
</dd></dl>
<dl class="data">
<dt id="restore">
<code class="descname">restore</code><a class="headerlink" href="#restore" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-restore</span></code></p>
<p>Use to look up previous settings in the comms.ini file</p>
</dd></dl>
<dl class="data">
<dt id="repeats">
<code class="descname">repeats</code><a class="headerlink" href="#repeats" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--repeats</span> <span class="pre">REPEATS</span></code></p>
<p>the number of times this block should repeat, by default this is 1</p>
</dd></dl>
<dl class="data">
<dt id="port">
<code class="descname">port</code><a class="headerlink" href="#port" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--port</span> <span class="pre">PORT</span></code></p>
<p>port that the Arduino is connected to</p>
</dd></dl>
<dl class="data">
<dt id="ITI">
<code class="descname">ITI</code><a class="headerlink" href="#ITI" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--ITI</span> <span class="pre">ITI</span> <span class="pre">ITI</span></code></p>
<p>an interval for randomising between trials</p>
</dd></dl>
<dl class="data">
<dt id="t_rDUR">
<code class="descname">t_rDUR</code><a class="headerlink" href="#t_rDUR" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-rdur</span> <span class="pre">T_RDUR,</span> <span class="pre">--t_rDUR</span> <span class="pre">T_RDUR</span></code></p>
<p>set end time of reward epoch</p>
</dd></dl>
<dl class="data">
<dt id="lickTrigReward">
<code class="descname">lickTrigReward</code><a class="headerlink" href="#lickTrigReward" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-ltr,</span> <span class="pre">--lickTrigReward</span></code></p>
<p>flag to allow licks to trigger the reward immediatly</p>
</dd></dl>
<dl class="data">
<dt id="t_stimONSET">
<code class="descname">t_stimONSET</code><a class="headerlink" href="#t_stimONSET" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--t_stimONSET</span> <span class="pre">T_STIMONSET</span></code></p>
<p>sets the time after trigger to run the first stimulus</p>
</dd></dl>
<dl class="data">
<dt id="datapath">
<code class="descname">datapath</code><a class="headerlink" href="#datapath" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">--datapath</span> <span class="pre">DATAPATH</span></code></p>
<p>path to save data to, by default is the current working directory</p>
</dd></dl>
<dl class="data">
<dt id="ID">
<code class="descname">ID</code><a class="headerlink" href="#ID" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-i</span> <span class="pre">ID,</span> <span class="pre">--ID</span> <span class="pre">ID</span></code></p>
<p>identifier for this animal/run</p>
</dd></dl>
<dl class="data">
<dt id="mode">
<code class="descname">mode</code><a class="headerlink" href="#mode" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-m</span> <span class="pre">MODE,</span> <span class="pre">--mode</span> <span class="pre">MODE</span></code></p>
<p>the mode <code class="docutils literal"><span class="pre">h</span></code> abituaton or <code class="docutils literal"><span class="pre">o</span></code> perant, by default will look in the
config table</p>
</dd></dl>
<dl class="data">
<dt id="timeout">
<code class="descname">timeout</code><a class="headerlink" href="#timeout" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-to</span> <span class="pre">TIMEOUT,</span> <span class="pre">--timeout</span> <span class="pre">TIMEOUT</span></code></p>
<p>set the timeout duration for incorrect licks</p>
</dd></dl>
<dl class="data">
<dt id="noLick">
<code class="descname">noLick</code><a class="headerlink" href="#noLick" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-nlp</span> <span class="pre">NOLICK,</span> <span class="pre">--noLick</span> <span class="pre">NOLICK</span></code></p>
<p>set <code class="docutils literal"><span class="pre">t_noLickPer</span></code> in arduino</p>
</dd></dl>
<dl class="data">
<dt id="weight">
<code class="descname">weight</code><a class="headerlink" href="#weight" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-w</span> <span class="pre">WEIGHT,</span> <span class="pre">--weight</span> <span class="pre">WEIGHT</span></code></p>
<p>weight of the animal in grams</p>
</dd></dl>
<dl class="data">
<dt id="trialDur">
<code class="descname">trialDur</code><a class="headerlink" href="#trialDur" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-td</span> <span class="pre">TRIALDUR,</span> <span class="pre">--trialDur</span> <span class="pre">TRIALDUR</span></code></p>
<p>set minimum trial duration</p>
</dd></dl>
<dl class="data">
<dt id="r_rDELAY">
<code class="descname">r_rDELAY</code><a class="headerlink" href="#r_rDELAY" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-rdel</span> <span class="pre">T_RDELAY,</span> <span class="pre">--t_rDELAY</span> <span class="pre">T_RDELAY</span></code></p>
<p>set start time of reward epoch</p>
</dd></dl>
<dl class="data">
<dt id="punish">
<code class="descname">punish</code><a class="headerlink" href="#punish" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-p,</span> <span class="pre">--punish</span></code></p>
<p>sets <code class="docutils literal"><span class="pre">break_wrongChoice</span></code> to True, incorrect licks will end an operant
trial early</p>
</dd></dl>
<dl class="data">
<dt id="noise">
<code class="descname">noise</code><a class="headerlink" href="#noise" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-noise</span></code></p>
<p>plays a noise during trials</p>
</dd></dl>
<dl class="data">
<dt id="reward_nogo">
<code class="descname">reward_nogo</code><a class="headerlink" href="#reward_nogo" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-rng,</span> <span class="pre">--reward_nogo</span></code></p>
<p>flag to allow a water delivery following no lick of a no go stim</p>
</dd></dl>
<dl class="data">
<dt id="lcount">
<code class="descname">lcount</code><a class="headerlink" href="#lcount" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal"><span class="pre">-lc</span> <span class="pre">LCOUNT,</span> <span class="pre">--lcount</span> <span class="pre">LCOUNT</span></code></p>
<p>set <code class="docutils literal"><span class="pre">minlickCount</span></code> in arduino</p>
</dd></dl>
</div>
<div class="section" id="interactive-options">
<h3>Interactive Options<a class="headerlink" href="#interactive-options" title="Permalink to this headline">¶</a></h3>
<table border="1" class="docutils">
<colgroup>
<col width="12%" />
<col width="88%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">key</th>
<th class="head">option</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>H</td>
<td>This menu</td>
</tr>
<tr class="row-odd"><td>P</td>
<td>Punish</td>
</tr>
<tr class="row-even"><td>S</td>
<td>toggle single stimulus</td>
</tr>
<tr class="row-odd"><td>< ></td>
<td>lick threshold</td>
</tr>
<tr class="row-even"><td>?</td>
<td>show threshold</td>
</tr>
<tr class="row-odd"><td>[ ]</td>
<td>lickcount</td>
</tr>
<tr class="row-even"><td>\</td>
<td>show lickcount</td>
</tr>
<tr class="row-odd"><td>tab</td>
<td>toggle mode</td>
</tr>
<tr class="row-even"><td>: “</td>
<td>adjust noLick period</td>
</tr>
<tr class="row-odd"><td>L</td>
<td>show noLick period</td>
</tr>
<tr class="row-even"><td>( )</td>
<td>adjust trial duration</td>
</tr>
<tr class="row-odd"><td>T</td>
<td>show trial duration period</td>
</tr>
<tr class="row-even"><td>Y</td>
<td>toggle timeout (requires punish to take effect)</td>
</tr>
<tr class="row-odd"><td>B</td>
<td>toggle bias correction</td>
</tr>
</tbody>
</table>
<ol class="arabic simple">
<li>The program starts</li>
<li>The program opens communications with available serial port The
program waits until it gets the arduino is active, and prints all
output until the ready signal is transmitted. Which is
<code class="docutils literal"><span class="pre">-</span> <span class="pre">Status:</span> <span class="pre">Ready</span></code></li>
<li>The program starts a block</li>
<li>The program transmits the dict <code class="docutils literal"><span class="pre">params</span></code>, which holds all parameters
for a single trial. The condition values get updated; based on the
frequencies being sent, all contents of <code class="docutils literal"><span class="pre">params</span></code> are transmitted to
the behaviour controller.</li>
<li>The program prints the frequencies and the condition to the screen
and a random timeout is started.</li>
<li>The program initiates a trial by sending a literal <code class="docutils literal"><span class="pre">"GO"</span></code> to the
behaviour box.<ul>
<li>The behaviour box runs one trial, with the parameters set
previously</li>
</ul>
</li>
<li>The program records the output from behaviorCOMs into a dict, which
later will be converted to a data frame for analysis.</li>
<li>The program repeats sending mode flags until all stimuli combinations
have been run through.</li>
</ol>
</div>
</div>
<div class="section" id="references">
<h2>References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Behaviour Box</a><ul>
<li><a class="reference internal" href="#software">Software</a><ul>
<li><a class="reference internal" href="#behaviourbox-ino">behaviourbox.ino</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
</ul>
</li>
<li><a class="reference internal" href="#setup-connections">Setup connections:</a></li>
<li><a class="reference internal" href="#global-variables">Global Variables</a></li>
<li><a class="reference internal" href="#files">Files</a><ul>
<li><a class="reference internal" href="#global-variables-h">global_variables.h</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#serialcontroller-py">SerialController.py</a><ul>
<li><a class="reference internal" href="#optional-arguments">Optional Arguments:</a></li>
<li><a class="reference internal" href="#interactive-options">Interactive Options</a></li>
</ul>
</li>
<li><a class="reference internal" href="#references">References</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">Welcome to behaviour_box’s documentation!</a></li>
<li>Next: <a href="Installation.html" title="next chapter">Install</a></li>
</ul></li>
</ul>
</div>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/description.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2017, Andrew Micallef.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.5</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
|
<a href="_sources/description.rst.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>