40 LED light games (Teensy card 3.6)

Status
Not open for further replies.

aybikikhano

New member
Hello ,

The purpose of this article is to learn how to gain autonomy in the use of the Teensy card 3.6.

Here is the description of the program I want to do (40 LED light games):
• The first 20 LEDs are off and (20-40) are on.
• The 20 LEDs light up 1 second (20-40) goes out.

• MY question is can it be done with my Teensy card 3.6 number of branches at output 40

Thanks
 
Yes it can be done with the Teensy, though there are some things you may need to consider.

Since the Teensy 3.6 has 51 digital pins, you could just hook up each LED to a digital pin and a resistor. Note, you will need to solder some wires to pads underneath the Teensy to get enough pins. Trying to connect 40+ wires, resistors, etc. quickly becomes unwieldy, and error prone. In addition, you will likely run into the 250mA limit the Teensy 3.6 has on the total 3.3v power, depending on the power draw of the lights and how many are on at the same time.

A second approach is to use WS2812B/SK6812 based LEDs (Adafruit calls these neopixels). These lights are a sequence of lights (similar to the lights used on Christmas trees) in that you only need one pin to program the LEDs, plus power and ground. Each successive LED is daisy chained from the previous LED. I.e. to program 40 LEDs, the library first sends the information for the first LED, then the second LED, then the third LED, etc. up to the 40th LED. Each light has 3 values from 0 to 255 for the red, green, and blue colors. So you adjust the color and intensity by adjusting the power levels (i.e. 0/0/0 turns off the light, 255/255/255 turns it on to the brightest amount and the eye registers it as white). You do have to watch the power levels with the LEDs (for example, turning on all 40 LEDs to full power is more power than you can get directly from a Teensy 3.6). There are various in/outs with WS2812B LEDs that show up as you get past just a few LEDs. You can buy WS2812B LEDs in various form factors (strands, circles, matrixes, etc.).

There is APA102 LEDs (Adafruit calls these dotstars) that are similar to the WS2812B's but they have 2 data pins to control the LEDs.

There are other methods (I2C expanders and shift registers), but in general you probably want to look at WS2812B LEDs.
 
Yes it can be done with the Teensy, though there are some things you may need to consider.

Since the Teensy 3.6 has 51 digital pins, you could just hook up each LED to a digital pin and a resistor. Note, you will need to solder some wires to pads underneath the Teensy to get enough pins. Trying to connect 40+ wires, resistors, etc. quickly becomes unwieldy, and error prone. In addition, you will likely run into the 250mA limit the Teensy 3.6 has on the total 3.3v power, depending on the power draw of the lights and how many are on at the same time.

A second approach is to use WS2812B/SK6812 based LEDs (Adafruit calls these neopixels). These lights are a sequence of lights (similar to the lights used on Christmas trees) in that you only need one pin to program the LEDs, plus power and ground. Each successive LED is daisy chained from the previous LED. I.e. to program 40 LEDs, the library first sends the information for the first LED, then the second LED, then the third LED, etc. up to the 40th LED. Each light has 3 values from 0 to 255 for the red, green, and blue colors. So you adjust the color and intensity by adjusting the power levels (i.e. 0/0/0 turns off the light, 255/255/255 turns it on to the brightest amount and the eye registers it as white). You do have to watch the power levels with the LEDs (for example, turning on all 40 LEDs to full power is more power than you can get directly from a Teensy 3.6). There are various in/outs with WS2812B LEDs that show up as you get past just a few LEDs. You can buy WS2812B LEDs in various form factors (strands, circles, matrixes, etc.).

There is APA102 LEDs (Adafruit calls these dotstars) that are similar to the WS2812B's but they have 2 data pins to control the LEDs.

There are other methods (I2C expanders and shift registers), but in general you probably want to look at WS2812B LEDs.



thank you for your reply ,

Anyway, I'm not going to use it to light up LEDs, I'm going to use it for my project, just to simplify it.
the most important is how to declare that?
which branch, I did not find examples on that
 
Status
Not open for further replies.
Back
Top