Skip to content

Commit 2eba11b

Browse files
author
lncd
committed
loeff on linux
1 parent 0cd8778 commit 2eba11b

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ results/.heroku-dburl
2020
results/*json
2121
results/*tsv
2222
results/*.csv
23-
results/data_id-hidden.tsv
23+
results/data_id-hidden.tsv
24+
psiclj-heroku

habit_loefeeg

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
trap '[ -n "$psiclj" ] && kill $psiclj && echo killed psiclj; test -n "$foxpid" && kill $_ && echo killed firefox;' EXIT SIGKILL
3+
cd "$(dirname "$(readlink -f "$0")")" || exit
4+
#./psiclj & # TODO: maybe launch in separate terminal?
5+
#java -cp psiclj.jar clojure.main -m psiclj &
6+
./psiclj-heroku &
7+
psiclj=$!
8+
echo "sleeping while java launches"
9+
sleep 1
10+
11+
echo "$(tput setaf 10)manually fullscreen browser (F11, or alt+v f) and ensure zoom 120% $(tput sgr0)"
12+
firefox http://127.0.0.1:3001/seeg.html &
13+
foxpid=$!
14+
15+
echo "# launching buttonbox/keyboard bridge"
16+
python3 ./http_ttl.py -v loeff
17+
18+
# done with everything. dont keep psiclj around
19+
# kills run by trap
20+
#kill $psiclj
21+
#kill $foxpid

http_ttl.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ async def loeffeeg(verbose=False):
357357
uses Cedrus response box (+attached photodiode)
358358
and TTL over LPT (biosemi)
359359
"""
360-
hw = LPT(address=0xD010, verbose=verbose)
360+
lpt_address = 0xD010 # 53264; for windows
361+
lpt_address = "/dev/parport0" # for linux
362+
hw = LPT(address=lpt_address, verbose=verbose)
361363
kb = KB()
362364
rb = Cedrus(hw, kb)
363365
http_run(hw)
@@ -408,7 +410,7 @@ async def test_keyboard(verbose=True):
408410
await asyncio.create_task(rb.watch())
409411

410412

411-
async def test_LPT(verbose=False, address=0xD010):
413+
async def test_LPT(verbose=False, address=0): #0xD010):
412414
"only test LPT. loop forever: send high and auto reset (loef eeg)"
413415
hw = LPT(address=address, verbose=verbose)
414416
while True:

0 commit comments

Comments
 (0)