Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure at gdx.read() at Python examples #44

Open
duodenum96 opened this issue Sep 27, 2022 · 1 comment
Open

Failure at gdx.read() at Python examples #44

duodenum96 opened this issue Sep 27, 2022 · 1 comment

Comments

@duodenum96
Copy link

Hello,

While trying to run the gdx_getting_started_usb.py with select_sensor([1]) and start(50) arguments, I get the following error:

Traceback (most recent call last):

File "C:\Users\user\Desktop\brain_stuff\josh\godirect-examples-main\python\gdx_getting_started_usb.py", line 36, in
measurements = gdx.read()

File "C:\Users\user\Desktop\brain_stuff\josh\godirect-examples-main\python\gdx\gdx.py", line 302, in read
if gdx.devices[i].read():

File "C:\Users\user\miniconda3\envs\hipokrat\lib\site-packages\godirect\device.py", line 181, in read
return self._GDX_read_measurement(timeout)

File "C:\Users\user\miniconda3\envs\hipokrat\lib\site-packages\godirect\device.py", line 401, in _GDX_read_measurement
return self._GDX_handle_measurement(response)

File "C:\Users\user\miniconda3\envs\hipokrat\lib\site-packages\godirect\device.py", line 416, in _GDX_handle_measurement
sensors = self._get_sensors_with_mask(sensor_mask)

File "C:\Users\user\miniconda3\envs\hipokrat\lib\site-packages\godirect\device.py", line 272, in _get_sensors_with_mask
sensors[i] = self._sensors[i]

KeyError: 2

Does anyone have any idea related to the reason of this?

@sswartley
Copy link
Contributor

Hello,

What happens when you run the example program without adding the arguments to select_sensor() and start()? It should provide you with a list of sensors to choose in the console, as well as allowing you to set the sampling period in the console. Can you choose a single sensor and set the sampling period in the console and run the program without the errror?

Sam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants