Profile cover photo
Profile photo
JP Roy


been away from microcontrollers and RGB light projects for while now and recently asked to build an improved version of a lamp I made with Arduino UNO and 8 strips of 25 WS2812.

My original sketch used an array of led arrays where the leds arrays were defined by...


and the controllers with...

FastLED.addLeds<NEOPIXEL, 11>(leds[0], NUM_LEDS_PER_STRIP);
FastLED.addLeds<NEOPIXEL, 12>(leds[1], NUM_LEDS_PER_STRIP); etc... etc...

This time I want to use a Teensy 3.1with it's OCTOWS2811 adapter (I have both on hand) and a lot more WS2812 leds. I want to benefit from the parallel output but also want to reuse my original sketch with minimum adaptations if possible !

The way I have used the Teensy in the past always used the single array multiple strips method such as...


Is it possible to define an array of led array using the Teensy ? How??

Sorry if this is a silly question or if it lacks required details. Thanks for any suggestions.

Post has attachment
Hello, I just bought a 3D printer kit, my 1st and the cheapest (200 US) I could find on Aliexpress. I know... I know... but that is the budget I had for yet another toy. I want to print various small mechanical parts in PLA with it. I really do not mind about printing speeds or fine details and really thought that even a cheap printer would work well enough for my current needs.

So I got this kit assembled just fine but for about 3 weeks I have not been able to extrude anything half decent with it. Technical support and communication with this Chinese vendor is torture and I have given up completely dealing with them. Mechanically, that kit proved to be a pleasant surprise as the XYZ movements are smoother than expected. My problem is with the hotend/extruder assembly only. The extruder assembly is a cheap MK8 type that just always gets partially or fully clogged. I am getting really good at disassembly, clearing clogs, reassembly only to find out that my problem just reappears. I can't get more than a few seconds of what I guess is a normal extrusion volume before I get (again) partially clogged. I just can't find 'THE problem' as everything looks ok to me. I read about bad PLA but can it really get that bad ??
Being a total noob at 3D printing I have a thousand questions but will start with just a few...
1) I found the hard way that you have to tighten the nozzle to the throat inside the heating block but wonder about that PTFE tube that often gets clogged solid requiring full disassembly. Currently the PTFE tube is not quite flush with the end of the throat. Should it be set in more inside the throat or to the contrary extend inside the nozzle itself !?
2) I have been digging YouTube and now this forum for info about Extruder/hotend. I see a lot of 'This is how you unclog your extruder' but this is not what I need. I am looking for a more in-depth tutorial for what causes clogs and jams and how to generally prevent them with various Extruder/hotend. Any suggestions ?
3) I am thinking of completely replacing that cheap MK8 and was looking at the well reviewed E3D V6 (or possibly a clone of it ?) with a direct extruder but can't find an off-the shelf kit that I can simply swap in. Any suggestions ?
I just can't wait to start printing, thanks in advance for any help !

Post has attachment
This is my 2015, sound and music reactive  Xmas tree.
Living in an apartment and having so many guests over, I simply could not afford the space of a full Xmas tree installation and this is what I came up with...
I 'squished' my Xmas tree in the 4" space between window panes of my living room patio door.
The tree has 332 WS2811 8mm RGB LEDs. A 20A PSU, an Arduino MEGA, a Bluetooth transceiver and a MSGEQ7 7-band audio analyser. I also built a small box with a 9V battery, microphone pre-amp with gain control to pickup ambiant sounds and music and send line level audio to Arduino and the MSGEQ7.
Merry Xmas all of you !!

Hi, I posted videos and pictures of a clock I built a while
back for my son. Details here...
Now he is asking me to add some new functionality and while
refreshing myself in the awful but still quite functional
spaghetti code I wrote, I am thrown off by the actual vs
expected behavior of the following rainbow function...
void rainbow (){
  for(int i = 419; i >= 0; i--) {
    int val = i;
    for (int led = 0; led < NUM_LEDS; led++) {
      val = val++ % 420;
      byte hue = map (val, 0, 419, 0, 255);
      leds[led] = CHSV(hue, 255, LED_MAX_BRIGHTNESS);
For my clock, NUM_LEDS = 555; So I would expect; to take 555 X 30µsec = 16.65 msec.
And since I loop around 420 times (The number of LEDs in my
clock section), the whole rainbow function should complete
in  more or less 420 X 16.65 msec ~~ 7 seconds. Of course
here I am ignoring the time to actually execute all the
other instructions, shouldn't they be insignificant in
comparison !?

Well, actually, it takes the function about 31 seconds to
complete!!  That is over 4 times more than I expected.
Where did i mess up in my maths ??  Any ideas ?? 

Post has attachment
Power distribution for my 2014 Xmas tree.
Here's a few pictures I took last year showing how I distributed power and data to my Xmas tree.
My tree was made of 34 separate branches each holding anywhere from 4(min) to 13(max) 8mm diffused RGB LEDs with WS2811 IC. The total number of RGB LEDs is 332.
Running from an Arduino MEGA with prototyping shield holding a Bluetooth module and a number of 4-pins connectors.
Powered from a single 5Vdc 20A PSU. Each branch gets it's data from a separate pin so, 34 different digital output pins were used. I did that to minimise visible wiring in the tree and to avoid having to daisy chain data from branch to branch.
Sorry about some pictures being blurry. Hope this gives some ideas to people wondering how to distribute power on their projects.
10 Photos - View album

Post has attachment
Atom visualization

Quickly adapted from Peter Chestna's original work !

Code to be found here:

I had to introduce a    delay(20);    after each show to slow it down to what you see in the video.

I am struggling a bit to 'dissect' the sketch and would appreciate some help.

1st issue: The following definition #define NUM_PIXELS 0

I can't understand why it works as many loops use NUM_PIXELS to draw and I am still getting nucleus and electrons with this set at 0 !?

2nd issue: Slowing down the electron spinning without the use of delay

I tried setting    const uint8_t kFracs = 16;    to higher values but it did not work well. Likely, I need to change the code in some other place(s) !?

3rd  issue: Different rotational planes for electrons.

The electrons currently cross paths at the top and bottom of the cube, any suggestions on how I can have some electrons crossing paths on the front and back !? on the left and right sides !?
What about how to get some of them to spinning backwards within the same plane !?

Thank you for any help, suggestions...

Post has attachment
Testing my 8mm diffused RGB LEDS...

For my 8X8X8 RGB LED cube, I needed 512 LEDs and I purchased 600, plenty for the build and some spares.

I started to wonder about the probability of brightness variations between the LEDs and decided to find a way to individually test those 600 RGB LEDS and ideally to pick 512 (and some spares...) closely matched for brightness levels in all 3 colors. I wanted to do this before I soldered them into that cube as I know that any repairs/replacements would be a serious pain !!

Following Jon Burroughs suggestion, I purchased a 'RGB Color Sensor with IR filter - TCS34725' from Adafruit and put together a jig made of some ABS pipe and couplings to create a mini dark room. I downloaded the Adafruit's TCS34725 library and put together a test sketch that drives the LED under test through brightness values 0,1,2,4,8,16,32,64,128, 255 for colors RED, GREEN, BLUE and WHITE. This actually tests that each brightness bit is working properly in the LED's PWM internal circuits. For each step in brightness, the sensor measures the light intensity of all 3 RGB colors and White color. I actually push the data to 2 devices to also verify the data out of the LED under test and that also gives me a visual of the test in progress.
That ends up being a huge set of collected data for a single complete pass through my test. 10 brightness steps X 4 colors X 4 measurements each = 160 measurements per LED. Actually for each of these 160 measurements, I ended up creating a table with a minimum and a maximum value for each measurement. I updated these values as I ran more LEDs through the tests as I did find variations between LEDs.
Now due to the LED's PWM control of brightness and the sensor's data integration times I had to make the test long enough that I did not get too much variation in the measurements because of when the sensor was measuring within the LED's PWM cycle ! 
That ended up being an excellent GO-NOGO test for the LEDs and although I did find variations of the measured values between the LEDs, when I visually compared LEDs that were at the minium range for a given value and another that was at the maximum, I could not really see a difference at all so I gave up that idea.
Here's a few pictures of that test jig...
5 Photos - View album

Post has attachment
First animation !
This is a slightly modified version of Peter Chestna Tortoise and Hare sketch.
Only added a snail to the mix...     ;-)

Post has attachment
Here's my...  well almost...  finished 8X8X8 cube.
Made essentially from:
512 8mm diffused RGB LEDs with integrated WS2811.
512 surface mount 0.1uF (1206 size)
Teensy 3.1 with the OCTOWS2811 adaptor.
5V 30A PSU.
Around 250 feet of 20 AWG tinned solid copper wire.
12" X 12" ½" MDF material for the base.

I have yet to do anything intelligent with animations. Currently I only have my test sketch that cycles all LEDs between Red, Green, Blue, Purple, Yellow, Cyan, White and all OFF.
With that very minimal test sketch, I am able to update the whole cube about 500 times per second. In the posted video, I am running this simple test loop for all basic colors:

void loop() {
    for(int i = 0; i < NUM_LEDS; i++) {
      leds[i] = CRGB(255,0,0);;
    for(int i = 0; i < NUM_LEDS; i++) {
      leds[i] = CRGB(0,255,0);;
etc...  etc...
I also include a few pictures that gives some idea of the build itself.

Hello all you enlightened people,

Back in February, I was just about ready to start on my dream of a 16X16X16 cube. Well...   that suddenly came to a grinding halt and has been on hold ever since...  :-(

I have now kind of revived that project but decided to go for a significantly smaller 8X8X8 size for now. My dream cube will simply have to wait...

Now, I have all my components on hand, Teensy3.1, OCTOWS2811 adapter, 150W 5V PSU, rolls of 20AWG solid tinned copper wire and a bag with 600 8mm RGB LEDs with embedded WS2811 chips and miscellaneous 'doo-dads' to complete the thing.

Now, I want to individually test those 600 RGB LEDS to pick 512 (and some...) with very uniform brightness levels for all 3 colors.
Real duds (If I find any...) should be easy to screen out but I am wondering about potential brightness variations (Chinese manufacturing you see...  ). I want to do this before I start soldering them into that cube as I know that any repairs will be a serious pain !!

So I would like to automate these tests and need to select some photo resistor or photo diode circuit that is sensitive enough at all 3 colors to detect the smallest possible variations in brightness. Any suggestions here ??

Wait while more posts are being loaded