forked from openbci-archive/OpenBCI_Python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_log.py
33 lines (26 loc) · 798 Bytes
/
test_log.py
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
import sys; sys.path.append('..') # help python find open_bci_v3.py relative to scripts folder
import open_bci_v3 as bci
import os
import logging
import time
def printData(sample):
#os.system('clear')
print "----------------"
print("%f" %(sample.id))
print sample.channel_data
print sample.aux_data
print "----------------"
if __name__ == '__main__':
port = '/dev/tty.usbserial-DN0096XA'
baud = 115200
logging.basicConfig(filename="test.log",format='%(message)s',level=logging.DEBUG)
logging.info('---------LOG START-------------')
board = bci.OpenBCIBoard(port=port, scaled_output=False, log=True)
#32 bit reset
board.ser.write('v')
time.sleep(0.100)
#connect pins to vcc
board.ser.write('p')
time.sleep(0.100)
#board.start_streaming(printData)
board.print_packets_in()