Page 1 of 1

Teensy problem with WS2812B

Posted: Thu Apr 01, 2021 11:09 am
by oharding
Hi!

I can run the test simple-test.ino script on both the teensy 3.2 and 4.0, but the single line serial script won't run. Sometimes it gives me some almost random output and glitches, but mostly, it's just black. I have connected the teensy to a mutual ground with the leds and the computer and the correct row of the script is uncommented also. I tried uncommenting the test and deubg rows in the script, but they gave me only glitches. For some time the leds actually displayed the correct output from madmapper, but it was still flickery. What might be the problem?

Re: Teensy problem with WS2812B

Posted: Thu Apr 01, 2021 8:03 pm
by mad-matt
Hi,
If you uncommented "//#define JUST_TEST_LEDS" and it's still not working, while the simple-test.ino is ok. The only difference I see is in the simple-test.ino, there's a "delay(10);". I doubt that could change anything but you can try the simple-test with this delay commented to see.
Are you sure the setup "FastLED.addLeds" and the definitions:
#define NUM_LEDS 500
#define DATA_PIN 5
#define CLOCK_PIN 6
are the same in both sketches ?
Cheers
Matt

Re: Teensy problem with WS2812B

Posted: Thu Apr 01, 2021 9:03 pm
by oharding
Hi,
If you uncommented "//#define JUST_TEST_LEDS" and it's still not working, while the simple-test.ino is ok. The only difference I see is in the simple-test.ino, there's a "delay(10);". I doubt that could change anything but you can try the simple-test with this delay commented to see.
Are you sure the setup "FastLED.addLeds" and the definitions:
#define NUM_LEDS 500
#define DATA_PIN 5
#define CLOCK_PIN 6
are the same in both sketches ?
Cheers
Matt
Yep, the sketches were original, only altered within the lines of the specific leds. I ried the delay and the result is still the same, even with two separate power sources and two separate led strips. Also with teensy 3.2 and 4.0. It seems to leave the only culprit as my computer, but what could be wrong with it? Thank You for the help!

Re: Teensy problem with WS2812B

Posted: Fri Apr 02, 2021 2:15 pm
by mad-matt
mmmm.... if you use the "single-line" sketch with "JUST_TEST_LEDS", it should do exactly the same as the other one. It's not even communicating with MadMapper or reading / writing on serial port. You can simplify the code to remove all useless things until you have the same code than the other one.
Are you using Teensyduino app ? Same process in both cases ?
I have no idea what your problem is...

Re: Teensy problem with WS2812B

Posted: Thu Apr 08, 2021 11:19 am
by oharding
mmmm.... if you use the "single-line" sketch with "JUST_TEST_LEDS", it should do exactly the same as the other one. It's not even communicating with MadMapper or reading / writing on serial port. You can simplify the code to remove all useless things until you have the same code than the other one.
Are you using Teensyduino app ? Same process in both cases ?
I have no idea what your problem is...
With further testing I have seen that the output starts only when I first open the serial monitor in arduino IDE. But still it flickers and the response is slow. Although if I set a solid colour, then the flicker disappears.

Re: Teensy problem with WS2812B

Posted: Thu Apr 08, 2021 11:28 am
by oharding
Also, the just test leds row works, but still only if I open serial monitor. At first, when I upload the script, the leds are just blank or have the output that was there from the last madmapper session. It will run on if I close serial monitor, but nothing will happen unless I open the monitor.

Re: Teensy problem with WS2812B

Posted: Thu Apr 08, 2021 12:09 pm
by oharding
Update: I found that the serial problem was caused by that Leonardo serial line, fixed that. But still there's awful amount of flickering

Re: Teensy problem with WS2812B

Posted: Thu Apr 08, 2021 12:26 pm
by oharding
OH MY GOD I SOLVED IT!! If someone has the same issue add (#define FASTLED_ALLOW_INTERRUPTS 0) just before defining FastLED!

Re: Teensy problem with WS2812B

Posted: Thu Apr 08, 2021 11:43 pm
by mad-matt
Great that you solved it. I never had to play with this "#define FASTLED_ALLOW_INTERRUPTS 0" but I might not have the same version of FastLED library, that might explain your issues.
I don't understand the relation between your teensy and "Leonardo serial line"

Re: Teensy problem with WS2812B

Posted: Fri Apr 09, 2021 10:30 am
by oharding
Great that you solved it. I never had to play with this "#define FASTLED_ALLOW_INTERRUPTS 0" but I might not have the same version of FastLED library, that might explain your issues.
I don't understand the relation between your teensy and "Leonardo serial line"
To be honest, me neither, but hey, it works.