Remote control two itsybitsy nrf52840 Express with neopixel

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Moloka
 
Posts: 3
Joined: Tue Jan 26, 2021 12:33 pm

Remote control two itsybitsy nrf52840 Express with neopixel

Post by Moloka »

Hello all,

first of all: I am an absolute beginner in programming. By using makecode I was already able to realize the project, however I would like to optimize it further and make it wireless.

Short description of the project:
I want to control two neopixel strings (10 LEDs each ), each installed to a device (e.g. ItsyBitsy nRF52840 Express), by using a wireless switch (also connected to an ItsyBitsy nRF52840 Express) via BLE as follows:

The neopixels of the two strings should basically light up in the color green. (2x 10 LEDs)
The switching unit shall consist of three pushbuttons and send the following commands.
Button 1: Neopixel of string no. 1 flashes in the color red
Button 2: All neopixels (2x 10 LEDs) light up in the color green
Button 3: Neopixel of string no. 2 flashes in the color red

For comparison/clarification: The principle can be compared to a turn signal of a car.
switch up = blink right / switch in the middle = off (here:green) / switch down = blink left

Currently I own two ItsyBitsy nRF52840 Express and experimented a bit with Circuitpython.
I could establish a connection, also signals could be sent/received.
Additionally I used "adafruit_led_animation.animation.blink import Blink" to get a neopixel string to blink, but it works pretty BANNED.

Unfortunately I haven't found a similar project yet, so I'm grateful for any tips.

Now my questions:
1. is it possible to pair and control two receivers with one transmitter at the same time?
2. how could a possible code look like?
3. have you programmed something similar?

I used the following project as an example (https://learn.adafruit.com/circuitpytho ... f/overview), but did not get the result I wanted.

Since I currently have only two Itsybitsy nRF52840 Express, I would try it with only one neopixel string. If in your opinion it can also work with two receivers, I would build on that and buy another controller.

I would appreciate any tips as I would very much like to realize this idea.

Thanks a lot
Best regards

User avatar
neradoc
 
Posts: 542
Joined: Wed Apr 27, 2016 2:38 pm

Re: Remote control two itsybitsy nrf52840 Express with neopixel

Post by neradoc »

Hi, I am not sure how well the library supports connecting multiple boards to the same central or the other way around. For a project with a switch like that though, I would not have the devices connect directly but rather use the adafruit_ble_radio library.

https://docs.circuitpython.org/projects ... en/latest/

The demo code uses a Circuitplayground Bluefruit but you can replace the use of the slide switch by a fixed boolean (one board being the sender, the other two receivers), and change the button pins to yours and make them do what you want. In the example they cycle through a list, you just want them to select a specific message.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”