there shouldn't be anything very complex: I will use
1 x I2C as a master,
1 x I2C as a slave (talking to a RPi)
and drive roughly 768 x WS2812B LEDs
Talking about WS2812B, can I still use Adafruit's library or you would recommend another one (such as FastLED instead) ? I'm a bit concerned by the fact that the Teensy have a 3V output, vs Arduino which is 5 V . Any advise ?
Note on Teensy's i2c, there are two libraries. The standard (
Wire.h), and a more complex Teensy oriented version (
i2c_t3.h). If you are using 2 i2c buses (one for master, one for slave), you probably need to use
i2c_t3.h. Note, the two libraries are incompatible. This means you will need to go through any libraries that use
Wire.h, and convert it to
i2c_t3.h. If you do use 2 i2c buses, the Teensy 3.5 and 3.6 are simpler because 2 of the i2c buses are on the main row of pins. On the 3.2, the second i2c bus is on solder pads underneath the Teensy.
However, if you are talking to the RPI, it may be simpler to use a different type of communication, such as a serial port. Then you don't have to switch to
i2c_t3.h. Another method might be plugging the Teensy's usb cable into the Pi, and use serial communications via USB.
Note, if your devices don't have pull-up resistors, you will need to add 2 pull-up resistors, one between the SDA pin and 3.3v, and the other between the SCL pin and 3.3v. Generally 2.2K is a good value. The 4.7K that is used for 5v devices like the Arduino, will work, but it won't let you go to the faster i2c speeds if it matters.
For 768 WS28128B leds, I would recommend looking at the Octows2811 shield and library. It drives the LEDs in 8 parallel streams, and uses all of the features of the Teensy (dma, etc.). It also has the appropriate level shifting built into the shield. Note, the Teensy LC cannot be used with the Octows2811 shield. The downside of the ws2811 shield is the pins for the 8 streams are fixed. Consult the page for suggestions about wiring, etc:
If you don't want the shield, you do want to use the
74HCT245 level shifter, which is fast enough to drive WS2812B leds. The bi-directional level shifters meant for i2c/spi might not be fast enough for the leds (I have found that for under 100 LEDs, the pololu.com level shifter did seem to work, but when you are dealing in hundreds of LEDs, you need to pay more attention to speed).
It is simpler if the i2c device you are talking to can run at 3.3v. Otherwise you will need to use a bi-direction level shifter for that.