Dotstar with Arduino nano 33 BLE

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
_phil
 
Posts: 12
Joined: Mon Aug 09, 2021 1:56 pm

Dotstar with Arduino nano 33 BLE

Post by _phil »

Hi all,
I have a problem with a project of mine:

I am trying to use a Arduino nano 33 BLE (must be this one as I need the Bluetooth functionality) to show icons and symbols on a 8x8 NeoPixel NeoMatrix. So far, not a problem.

Now I want to make the switch to the Dotstar High Density 8x8 grid, because I need the smaller form factor. Unfortunately, the Dotstar-Library for Arduino isn't supported for the nano 33 BLE, that uses the nRF52840 microcontroller.

Now I tried to solve that problem by using the NeoPixelBus library (https://github.com/Makuna/NeoPixelBus), which according to its documentation supports the Arduino nano 33 BLE as well as the APA102-Chipset the Dotstar grid uses. I am also using a logic level shifter as shown in the adafruit documentation (https://learn.adafruit.com/assets/63125).

To test this setup, I am using the DotStarTest of NeoPixelbus (https://github.com/Makuna/NeoPixelBus/b ... arTest.ino). The code compiles and uploads, but the LEDs don't light up. I can also see the supposed on/off switching on the serial bus while the sketch runs, but there is no lighting up of LEDs.

What I did troubleshooting-wise:
- test the LED-grid with an Arduino nano using the strandtest -> works
- test the connection and the logic level shifter using a neopixel-stick (which is supported for the nano 33 BLE) -> works
- try the hardware-SPI pins on the nano 33 BLE (data: 11; clock: 13) because apparantly bitbanging doesn't work on the nano 33 BLE

I am a bit of a loss here, any suggestions what might be the problem?



Also, if there is no solution to this problem, I am thinking about switching to the Adafruit nRF52840 Feather. But as I started with Arduino and haven't used feathers yet, I have a few questions:
- Will this board work with BLE and Dotstar-LEDs? As it also uses a nRF52840, I fear that the Dotstar-Library will once again not be supported.
- I can use it with the Arduino IDE, that much i understood, but can I also use the same code that I already wrote?


Thanks in advance
Philip

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Dotstar with Arduino nano 33 BLE

Post by adafruit_support_mike »

The Nano 33 should be able to run DotStars.. the APA102 data protocol is a bit simpler than NeoPixel signals, and doesn’t put any strange demands on the microcontroller.

Try using our DotStar library and see if that works:

https://github.com/adafruit/Adafruit_DotStar

User avatar
_phil
 
Posts: 12
Joined: Mon Aug 09, 2021 1:56 pm

Re: Dotstar with Arduino nano 33 BLE

Post by _phil »

No it unfortunately does not. When I try to compile for example the DotStar strandtest, I get the following error:

Code: Select all

...filestructure...\libraries\Adafruit_DotStar\Adafruit_DotStar.cpp: In member function 'void Adafruit_DotStar::hw_spi_init()':
...filestructure...\libraries\Adafruit_DotStar\Adafruit_DotStar.cpp:189:7: error: 'class arduino::MbedSPI' has no member named 'setClockDivider'
   SPI.setClockDivider((F_CPU + 4000000L) / 8000000L); // 8-ish MHz on Due
       ^~~~~~~~~~~~~~~
...filestructure...\libraries\Adafruit_DotStar\Adafruit_DotStar.cpp:189:24: error: 'F_CPU' was not declared in this scope
   SPI.setClockDivider((F_CPU + 4000000L) / 8000000L); // 8-ish MHz on Due
                        ^~~~~
...filestructure...\libraries\Adafruit_DotStar\Adafruit_DotStar.cpp:189:24: note: suggested alternative: 'FPU'
   SPI.setClockDivider((F_CPU + 4000000L) / 8000000L); // 8-ish MHz on Due
                        ^~~~~
                        FPU
...filestructure...\libraries\Adafruit_DotStar\Adafruit_DotStar.cpp:192:7: error: 'class arduino::MbedSPI' has no member named 'setBitOrder'
   SPI.setBitOrder(MSBFIRST);
       ^~~~~~~~~~~
...filestructure...\libraries\Adafruit_DotStar\Adafruit_DotStar.cpp:193:7: error: 'class arduino::MbedSPI' has no member named 'setDataMode'
   SPI.setDataMode(SPI_MODE0);
       ^~~~~~~~~~~
exit status 1
Fehler beim Kompilieren für das Board Arduino Nano 33 BLE.
The last line being "error while compiling for Board Arduino Nano 33 BLE" in german. From what I found with google it has to do with the MbedOS on the Nano 33 BLE.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Dotstar with Arduino nano 33 BLE

Post by adafruit_support_mike »

Ah.. the Mbed environment changes the way things work.

We don't have a lot of experience with that platform, but a bit of searching shows that people have gotten DotStars to work in Mbed code. There's a library here, if that helps:

https://github.com/laveur/Adafruit_DotStar_mbed

User avatar
_phil
 
Posts: 12
Joined: Mon Aug 09, 2021 1:56 pm

Re: Dotstar with Arduino nano 33 BLE

Post by _phil »

Unfortunately that doesn't work either. When trying to compile using that library i get the following error message:

Code: Select all

Arduino: 1.8.15 (Windows 10), Board: "Arduino Nano 33 BLE"

In file included from ...filestructure...\AppData\Local\Temp\arduino_modified_sketch_447287\strandtest.ino:8:0:

...filestructure...\libraries\Adafruit_DotStar_mbed/Adafruit_DotStar_mbed.h:184:3: error: 'DigitalInOut' does not name a type; did you mean 'digitalRead'?

   DigitalInOut      dataPin;               ///< Mbed Data Output Pin

   ^~~~~~~~~~~~

   digitalRead

...filestructure...\libraries\Adafruit_DotStar_mbed/Adafruit_DotStar_mbed.h:185:3: error: 'DigitalInOut' does not name a type; did you mean 'digitalRead'?

   DigitalInOut      clockPin;              ///< Mbed Clock Output Pin

   ^~~~~~~~~~~~

   digitalRead

strandtest:18:65: error: invalid conversion from 'int' to 'PinName' [-fpermissive]

 Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);

                                                                 ^

In file included from ...filestructure...\AppData\Local\Temp\arduino_modified_sketch_447287\strandtest.ino:8:0:

...filestructure...\libraries\Adafruit_DotStar_mbed/Adafruit_DotStar_mbed.h:100:3: note:   initializing argument 2 of 'Adafruit_DotStar::Adafruit_DotStar(uint16_t, PinName, PinName, uint8_t)'

   Adafruit_DotStar(uint16_t n, PinName d, PinName c, uint8_t o=DOTSTAR_BRG);

   ^~~~~~~~~~~~~~~~

strandtest:18:65: error: invalid conversion from 'int' to 'PinName' [-fpermissive]

 Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);

                                                                 ^

In file included from ...filestructure...\AppData\Local\Temp\arduino_modified_sketch_447287\strandtest.ino:8:0:

...filestructure...\libraries\Adafruit_DotStar_mbed/Adafruit_DotStar_mbed.h:100:3: note:   initializing argument 3 of 'Adafruit_DotStar::Adafruit_DotStar(uint16_t, PinName, PinName, uint8_t)'

   Adafruit_DotStar(uint16_t n, PinName d, PinName c, uint8_t o=DOTSTAR_BRG);

   ^~~~~~~~~~~~~~~~

exit status 1

invalid conversion from 'int' to 'PinName' [-fpermissive]

My knowledge in libraries is extremely basic, so I don't know how to solve this...

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Dotstar with Arduino nano 33 BLE

Post by adafruit_support_mike »

The process is almost always the same: find something that claims to work, and copy it exactly to see if it works for you. If it doesn’t, move on to another example.

Once you find something that does work, read the code and try to build the simplest version of a working system you can. The trial and error you go through is an essential part of building a useful mental model of the system. The fact that you’re building in relation to something known to work makes it easier to identify ideas that work and ideas that don’t.

Before long you’ll have a good enough mental model to write code that works from memory.

Then you’re ready to take that knowledge into a new environment. You’ll also have a lot of experience figuring out things that didn’t work, which will be enormously helpful when things don’t work in the new environment.

Always start as simple as you can though, and move from success to success. It’s easy to build out from a trivial-but-functional base. It’s much, much harder to do something compkex and then try to figure out why it didn’t work.

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

Return to “Arduino”