Hi everyone,
I am posting inside Trinket group, but I want to ask regarding Gemma M0.
How to turn off the built-in LED DOTSTAR.
I am using Arduino IDE.
Turn off built-in DOTSTAR LED
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- dastels
- Posts: 15763
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Turn off built-in DOTSTAR LED
For how to control dotstars see https://learn.adafruit.com/adafruit-dotstar-leds. For the pins to use on the GemmaM0 see https://learn.adafruit.com/assets/49776.
Then just set it to black (i.e. #000000).
Dave
Then just set it to black (i.e. #000000).
Dave
- hatem0
- Posts: 4
- Joined: Wed Jan 19, 2022 11:00 am
Re: Turn off built-in DOTSTAR LED
These links were informative, but still I am not able to turn the built-in DOTSTAR OFF.dastels wrote:For how to control dotstars see https://learn.adafruit.com/adafruit-dotstar-leds. For the pins to use on the GemmaM0 see https://learn.adafruit.com/assets/49776.
Then just set it to black (i.e. #000000).
Dave
It should be easy, but I feel shy that I can't make it works.
the DOTSTAR always showing magenta, whatever color combination I use.
Code: Select all
#include <Adafruit_DotStar.h>
#include <avr/power.h>
#define NUMPIXELS 1
Adafruit_DotStar strip(NUMPIXELS, DOTSTAR_BRG);
uint32_t color = 0x000000;
void setup()
{
strip.begin();
}
void loop()
{
strip.setPixelColor(0, color);
strip.show();
}
- dastels
- Posts: 15763
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Turn off built-in DOTSTAR LED
You're not specifying the pins for the builtin DotStar. Clock is on digital pin 4, and data is digital pin 3. E.g.:
Dave
Code: Select all
Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
- hatem0
- Posts: 4
- Joined: Wed Jan 19, 2022 11:00 am
Re: Turn off built-in DOTSTAR LED
Thanks, it working now.
I will post the full code for reference.
I will post the full code for reference.
Code: Select all
//Turn off built-in DOTSATR LED in Gemma M0 board.
#include <Adafruit_DotStar.h>
#include <avr/power.h>
#define NUMPIXELS 1
#define DATAPIN 3
#define CLOCKPIN 4
Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
void setup()
{
strip.begin();
strip.show();
}
void loop()
{
}
- dastels
- Posts: 15763
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Turn off built-in DOTSTAR LED
Excellent!
Dave
Dave
- cmj879
- Posts: 9
- Joined: Fri Sep 13, 2019 3:02 am
Re: Turn off built-in DOTSTAR LED
I want to turn off the DotStar on a Trinket M0. This code is not working. The program uploads, but the serial port disables. I checked the hardware with Blink and it works and the serial port remains. I'm running Windows 10 and have not installed Adafruit drivers. Just wanted to see if there is some other issue before I mess with the drivers:
Code: Select all
#include <Adafruit_DotStar.h>
#define NUMPIXELS 1 // Number of DotStar LEDs in strip
#define DATAPIN 7
#define CLOCKPIN 8
Adafruit_DotStar strip(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
void setup() {
strip.begin();
strip.show(); // turn off the *%$*@ DotStar
}
void loop() {
}
- dastels
- Posts: 15763
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Turn off built-in DOTSTAR LED
Does the dotstar turn off?
Dave
Dave
- XRAD
- Posts: 754
- Joined: Sat Nov 19, 2016 3:28 pm
Re: Turn off built-in DOTSTAR LED
try this, avoids pin confusion....
Code: Select all
#include <Adafruit_DotStar.h>
Adafruit_DotStar dot = Adafruit_DotStar(1, INTERNAL_DS_DATA, INTERNAL_DS_CLK, DOTSTAR_BGR);
void setup() {
dot.begin();
dot.show();
}
void loop() {
}
Please be positive and constructive with your questions and comments.