RGB LED Project (sending data to RGB strips)

Status
Not open for further replies.

GanicCreations

New member
Hello everyone,
This is my first post here and first couple times messing with the teensy platform. All I want to do to start my project is to send data to an led strip (99 LEDS 12volt) the color blue. I have tried just about every accessible data pin on the teensy and only 11 and 21 work for me. I have my code I hand wrote myself. I am sorry if the wiring is difficult to see how everything goes, this is a prototype and will be prettied up later on. But essentially I have a 5volt regulator taking the 12volts from the batteries and converting to 5 volts to power the teensy as well as an RF receiver which will not be used yet. Do not mind the two resistors and ceramic capacitor, that like the RF receiver is for later on. This is a teensy 3.6 and I am using the Arduino program to send code to it. I know that I currently have the LED strip in pin 3 but when testing I have jumped the pin 5 to the LED data wire and still no success.

I was unable to insert my images so I put them into a google photos shared album, here is the link for it.
https://photos.app.goo.gl/tHXUdjUmFomDc6G89



Code:
#include <WS2812Serial.h>
#include <FastLED.h>
#define NUM_LEDS  10
const int LED_PIN  = 5;

CRGB leds[NUM_LEDS];
void setup() {
  pinMode(5, OUTPUT);
  FastLED.addLeds<WS2812B, 1, GRB>(leds, 10);
  FastLED.setBrightness(100);
}
  void loop() {
    for (int i = 0; i <10; i++)
    {
      leds[i] = CRGB::Blue;

    }
    FastLED.show();
  }

I would like to add that I have tested this code with an Arduino Mega and it is working flawlessly.
 
On the line "FastLED.addLeds<WS2812B, 1, GRB>(leds, 10);" the "1" refers to the pin number.
You'll have better luck with "FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, 10);"
 
Status
Not open for further replies.
Back
Top