DotStar Control on the ItsyBitsy M0 Express

Please tell us which board you are using.
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
johnpritch
 
Posts: 17
Joined: Thu Mar 02, 2017 9:57 pm

DotStar Control on the ItsyBitsy M0 Express

Post by johnpritch »

Hello,

I have a light-sensitive application using the ItsyBitsy M0 Express and need the DotStar LED to be off during measurements. Unfortunately I can't seem to turn it off with the test code I'm running below. After uploading the code, the DotStar remains purple, never gets to the loop (blinky red light), and I get a "USB Device not recognized" message from windows. After that, I can still run the bootloader by double-clicking the reset button.

I assume I am using the Adafruit_DotStar object incorrectly, your assistance is much appreciated!

Thanks,
John

Summary of the situation:
  • Board: ItsyBitsy M0 Express
  • IDE: Arduino
  • Checks: UF2 bootloader opens w/ a double-click of the reset, I can run blinky code alone blinking the on-board red LED, DotStart data pin set to 41 and clock pin 40 on the ItsyBitsy M0 Express
  • Code: Example code below
  • Problem: DotStar remains purple instead of turning off when running example code, and "USB not rec." message pops up in Windows
Code that works:

Code: Select all

#include <Adafruit_DotStar.h>

Adafruit_DotStar dot = Adafruit_DotStar(1, 41, 40, DOTSTAR_BGR);

void setup() {
 //dot.begin();
 //dot.show();
 pinMode(13,OUTPUT);
}

void loop() {
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(13,LOW);
  delay(100);
}
Code that doesn't work (simply uncommented dot.begin/show):

Code: Select all

#include <Adafruit_DotStar.h>

Adafruit_DotStar dot = Adafruit_DotStar(1, 41, 40, DOTSTAR_BGR);

void setup() {
 dot.begin();
 dot.show();
 pinMode(13,OUTPUT);
}

void loop() {
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(13,LOW);
  delay(100);
}
Picture of my setup, just the ItsyBitsy M0 Express plugged into USB:
itsybitsym0-setup.jpg
itsybitsym0-setup.jpg (775.87 KiB) Viewed 260 times

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: DotStar Control on the ItsyBitsy M0 Express

Post by adafruit_support_carter »

Weird behavior. Everything looks OK in your sketch. Is the problem repeatable? You can go back and forth between the working and non-working code and get the same behavior each time?

User avatar
johnpritch
 
Posts: 17
Joined: Thu Mar 02, 2017 9:57 pm

Re: DotStar Control on the ItsyBitsy M0 Express

Post by johnpritch »

adafruit_support_carter wrote:Is the problem repeatable? You can go back and forth between the working and non-working code and get the same behavior each time?
Yes it's repeatable, I can go back and forth between working/non-working sketches. I confirmed repeatability on multiple ItsyBitsy M0 Express boards as well (uploaded the non-working sketch immediately to an out-of-the-box ItsyBitsy).

After some trial and error I solved the problem for now, but it seems to be an issue with the Adafruit_DotStar v1.2.0 library.

I deleted the library in Documents\Arduino\libraries, then installed Adafruit_DotStar v1.1.5 via Tools > Manage Libraries... menu in Arduino. Now both sketches work on both of my ItsyBitsy M0 Express boards. To confirm, I deleted the library again, installed v1.2.0, and confirmed the non-working sketch hangs before it gets to the loop() function.

So now with the Adafruit_DotStar v1.1.5 library, this code works:

Code: Select all

#include <Adafruit_DotStar.h>

Adafruit_DotStar dot = Adafruit_DotStar(1, 41, 40, DOTSTAR_BGR);

void setup() {
 dot.begin();
 dot.show();
 pinMode(13,OUTPUT);
}

void loop() {
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(13,LOW);
  delay(100);
}
Working board:
itsybitsym0-setup2.jpg
itsybitsym0-setup2.jpg (811.99 KiB) Viewed 251 times

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: DotStar Control on the ItsyBitsy M0 Express

Post by adafruit_support_carter »

Just tested an Itsy M0 with DotStar library v1.2.0 and your non-working sketch above. Can't recreate the issue. The sketch runs as expected (blinking red LED) and no loss of the connection to the board.

Not sure what about the library difference would matter. Seems like it might be something specific to your setup. If we can recreate the issue, we can investigate. But for now, it seems like you have a work around by reverting to an older release of the library.

User avatar
johnpritch
 
Posts: 17
Joined: Thu Mar 02, 2017 9:57 pm

Re: DotStar Control on the ItsyBitsy M0 Express

Post by johnpritch »

adafruit_support_carter wrote:Seems like it might be something specific to your setup.
OK I found the issue - yes it was something specific to my setup.

In response to this I used a different Windows PC and installed arduino, adafruit board support, and the dotstar library fresh. I got a notice that dotstar depends on Adafruit BusIO, so I installed both, and my test code worked just fine with dotstar v1.2.0.

I went back to my original PC and sure enough the BusIO library wasn't updated. Once I updated that, everything worked as expected.

Sorry about the runaround - I'll make sure my libraries are updated!

John

User avatar
adafruit_support_carter
 
Posts: 29150
Joined: Tue Nov 29, 2016 2:45 pm

Re: DotStar Control on the ItsyBitsy M0 Express

Post by adafruit_support_carter »

Cool, glad you resolved it for real. Thanks for the update!

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

Return to “Itsy Bitsy Boards”