Getting Zeros for Accelerometer Data from Ganglion using Brainflow

Ay07Ay07 United States
edited May 10 in General Discussion

As the title states, I am trying to get accelerometer data from my Ganglion board using Brainflow, but I am only getting zeros. I have the code below, and the EEG data is printing correctly, so I know that the program is connecting with

import time
import numpy as np
import brainflow
from brainflow.board_shim import BoardShim, BrainFlowInputParams, LogLevels, BoardIds
from brainflow.data_filter import DataFilter, FilterTypes, AggOperations
BoardShim.enable_dev_board_logger()
params = BrainFlowInputParams()
params.serial_port = '/dev/cu.usbmodem11'
board = BoardShim(BoardIds.GANGLION_BOARD.value, params) # added ganglion board id here
srate = board.get_sampling_rate(BoardIds.GANGLION_BOARD.value)
board.prepare_session()
board.start_stream()
eeg_chan = BoardShim.get_eeg_channels(BoardIds.GANGLION_BOARD.value)
aux_chan = BoardShim.get_accel_channels(BoardIds.GANGLION_BOARD.value)
print('EEG channels')
print(eeg_chan)
print('Accelerometer channels')
print(aux_chan)
SCALE_FACTOR_EEG = (4500000)/24/(2**23-1) #uV/count
SCALE_FACTOR_AUX = 0.002 / (2**4) 

while True:
    data = board.get_current_board_data(1) # this gets data continiously
    # don't send empty data
    if len(data[0]) < 1 : continue
    time.sleep(1)
    scaled_eeg_data = data[eeg_chan]*SCALE_FACTOR_EEG
    scaled_aux_data = data[aux_chan]*SCALE_FACTOR_AUX
    print(scaled_eeg_data)
    print(scaled_aux_data)

Comments

  • wjcroftwjcroft Mount Shasta, CA

    Hi Ayan,

    Please join the Brainflow Slack, link on the page below. Then ask your question in the 'help' section.

    https://brainflow.org/

    Regards, William

Sign In or Register to comment.