Skip to content

Commit

Permalink
ADD: Toggle accelerometer for Wifi Ganglion
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjz committed Apr 25, 2018
1 parent bda9130 commit f5b1a02
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions openbci/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,21 @@ def set_sample_rate(self, sample_rate):
except Exception as e:
print("Something went wrong while setting sample rate: " + str(e))

def set_accelerometer(self, toggle_position):
""" Enable / disable accelerometer """
try:
if self.board_type == k.BOARD_GANGLION:
# Commands to set toggle to on position
if toggle_position == 1:
self.wifi_write('n')
# Commands to set toggle to off position
elif toggle_position == 0:
self.wifi_write('N')
else:
print("Board type not supported for setting accelerometer")
except Exception as e:
print("Something went wrong while setting accelerometer: " + str(e))

"""
Clean Up (atexit)
Expand Down

0 comments on commit f5b1a02

Please sign in to comment.