0

Controlling NeoPixel Jewel for psychological experiment
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Controlling NeoPixel Jewel for psychological experiment

by kobebest on Wed Apr 24, 2019 7:56 am

Dear Adafruit community,

I am quite new to this world, but I will try to explain my problem.

I am planning to run an experiment, in which participants will have to act on an object as soon as it lights up. Different colors different actions to perform. To do this I was planning to use Psychopy, or something similar, as I would need also to present acoustic cues, other visual cues, and I need an accurate time resolution.

One example would be this one. The participant hears a sound, he starts the movement to approach the object. Then, 250ms after the sound, the object becomes blue and the participant has to move the object away.

So, I bought "NeoPixel Jewel - 7 x 5050 RGB LED with Integrated Drivers" but now I am facing different issues. If I use Arduino, it cannot be controlled through Python, but only through Arduino IDE. On the other hand, if I use Raspberry Pi, I can program with Python but only within the Raspberry Pi itself, losing accuracy in terms of milliseconds (like briefly discussed here https://discourse.psychopy.org/t/psycho ... ry-pi/3124).

My question, then, is this one: is there a way in which I can control the NeoPixel using Python or a Python-based software? Is there a way to connect the NeoPixel to some hardware directly controllable from bash/python?

Thank you very much

kobebest
 
Posts: 1
Joined: Wed Apr 24, 2019 7:31 am

Re: Controlling NeoPixel Jewel for psychological experiment

by adafruit_support_bill on Wed Apr 24, 2019 9:22 am

It is possible to control a Neopixel using Python on something like a Metro M0 Express: https://www.adafruit.com/product/3505

Note that Python in general is not the best choice for high-resolution timing. C++ with the Arduino IDE is much more precise. However, if you keep your Python program simple, millisecond level accuracy should be achievable.

adafruit_support_bill
 
Posts: 74907
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.