I’m trying to add a Grove LED Bar to a Teensy 4.1 project.
https://wiki.seeedstudio.com/Grove-LED_Bar/#tech-support--product-discussion
The problem is that the bar graph doesn’t respond immediately, or even at all.
The same test sketch works fine with a UNO.
Is the Teensy 4.1 too fast?
Do I need to use specific pins for the CLK and Data signals?
Thanks
https://wiki.seeedstudio.com/Grove-LED_Bar/#tech-support--product-discussion
The problem is that the bar graph doesn’t respond immediately, or even at all.
The same test sketch works fine with a UNO.
Is the Teensy 4.1 too fast?
Do I need to use specific pins for the CLK and Data signals?
Thanks
C++:
#include <Grove_LED_Bar.h>
#define Bouton 4
Grove_LED_Bar bar(24, 25, 1, LED_BAR_10); // Clock pin, Data pin, Orientation
void setup() {
// nothing to initialize
bar.begin();
pinMode(Bouton, INPUT_PULLUP);
pinMode(13, OUTPUT);
}
void loop() {
if (digitalRead(Bouton) == LOW) {
digitalWrite(13, HIGH);
bar.setLevel(10);
//for (int i = 1; i <= 10; i++) {
// bar.setLed(i, i * 0.1);
}
else {
digitalWrite(13, LOW);
bar.setLevel(1);
//for (int i = 1; i <= 10; i++) {
// bar.setLed(i, 1-(i * 0.1));
}
}