Permalink
Browse files

Updated tests

  • Loading branch information...
1 parent 38d65e4 commit 445780438f1d5165f03d8bfda5c067146cb687cc @rceballos98 rceballos98 committed Jul 27, 2015
Showing with 29 additions and 3 deletions.
  1. +9 −1 open_bci_v3.py
  2. +16 −0 scripts/simple_serial.py
  3. +4 −2 scripts/test.py
View
@@ -25,6 +25,7 @@ def handle_sample(sample):
import logging
import threading
import sys
+import pdb
SAMPLE_RATE = 250.0 # Hz
START_BYTE = 0xA0 # start of data packet
@@ -73,13 +74,17 @@ def __init__(self, port=None, baud=115200, filter_data=True,
print("Connecting to %s" %(port))
self.ser = serial.Serial(port= port, baudrate = baud, timeout=timeout)
+
print("Serial established...")
+ time.sleep(2)
#Initialize 32-bit board, doesn't affect 8bit board
self.ser.write('v');
+
#wait for device to be ready
time.sleep(1)
+ print("Incoming:")
self.print_incoming_text()
self.streaming = False
@@ -305,7 +310,8 @@ def print_incoming_text(self):
"""
line = ''
#Wait for device to send data
- time.sleep(0.5)
+ time.sleep(1)
+
if self.ser.inWaiting():
line = ''
c = ''
@@ -314,6 +320,8 @@ def print_incoming_text(self):
c = self.ser.read()
line += c
print(line);
+ else:
+ self.warn("No Message")
def print_register_settings(self):
self.ser.write('?')
View
@@ -0,0 +1,16 @@
+import serial
+import struct
+import numpy as np
+import time
+import timeit
+import atexit
+import logging
+import threading
+import sys
+import pdb
+
+port = '/dev/tty.OpenBCI-DN008VTF'
+#port = '/dev/tty.OpenBCI-DN0096XA'
+baud = 115200
+ser = serial.Serial(port= port, baudrate = baud, timeout = None)
+pdb.set_trace()
View
@@ -15,12 +15,14 @@ def printData(sample):
if __name__ == '__main__':
- port = '/dev/tty.usbserial-DN0096XA'
+ port = '/dev/tty.OpenBCI-DN008VTF'
+ #port = '/dev/tty.OpenBCI-DN0096XA'
baud = 115200
logging.basicConfig(filename="test.log",format='%(asctime)s - %(levelname)s : %(message)s',level=logging.DEBUG)
logging.info('---------LOG START-------------')
board = bci.OpenBCIBoard(port=port, scaled_output=False, log=True)
+ print("Board Instantiated")
board.ser.write('v')
- time.sleep(0.100)
+ time.sleep(10)
#board.start_streaming(printData)
board.print_bytes_in()

0 comments on commit 4457804

Please sign in to comment.