-
Notifications
You must be signed in to change notification settings - Fork 207
/
test_log.py
35 lines (27 loc) · 895 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
34
35
from __future__ import print_function
import time
import logging
from openbci import cyton as bci
import sys
sys.path.append('..') # help python find cyton.py relative to scripts folder
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.OpenBCICyton(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()