Skip to content

Commit 644cbc3

Browse files
author
AJ Keller
committed
ADD: support for wifi shield
1 parent 04ea38f commit 644cbc3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

openbci/wifi.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,16 @@ class OpenBCIWiFi(object):
5656
"""
5757

5858
def __init__(self, ip_address=None, shield_name=None, sample_rate=None, log=True, timeout=3,
59-
max_packets_to_skip=20, latency=10000, high_speed=True, ssdp_attempts=5):
59+
max_packets_to_skip=20, latency=10000, high_speed=True, ssdp_attempts=5,
60+
num_channels=8):
6061
# these one are used
6162
self.high_speed = high_speed
6263
self.impedance = False
6364
self.ip_address = ip_address
6465
self.latency = latency
6566
self.log = log # print_incoming_text needs log
6667
self.max_packets_to_skip = max_packets_to_skip
68+
self.num_channles = num_channels
6769
self.sample_rate = sample_rate
6870
self.shield_name = shield_name
6971
self.ssdp_attempts = ssdp_attempts
@@ -157,6 +159,8 @@ def connect(self):
157159
gains = None
158160
if self.board_type == k.BOARD_CYTON:
159161
gains = [24, 24, 24, 24, 24, 24, 24, 24]
162+
elif self.board_type == k.BOARD_DAISY:
163+
gains = [24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24]
160164
elif self.board_type == k.BOARD_GANGLION:
161165
gains = [51, 51, 51, 51]
162166
self.local_wifi_server.set_parser(ParseRaw(gains=gains, board_type=self.board_type))

scripts/stream_data_wifi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55

66
def printData(sample):
7-
print(sample)
7+
print(sample.sample_number)
8+
print(sample.channel_data)
89

910

1011
if __name__ == '__main__':

0 commit comments

Comments
 (0)