WS2812Serial Wont Work on Pins other than 1

Status
Not open for further replies.

kuwala

New member
I have a project where I am using an Audio Shield and a Teensy 3.6. To build a large light up keyboard.
I am trying to get the WS2812Serial to work on pin 33 which is Serial5 of the Teensy 3.6.

Trouble shooting the project I am just trying to get the WS2812Serial to work on its own with the simple example code. All I can get it to do is work on pin 1.

I have tried Pin 5, Pin 8, Pin 33. NeoPixel library works on those pins, but not the WS2812Serial.

I have no idea what could be wrong. There is no error message.
Any help and a sanity check would be much appreciated THANKS!:confused:

I am using
Arduino 1.8.5 Teensyduino 1.41

Code:
/* WS2812Serial BasicTest Example

   Test LEDs by turning then 7 different colors.

   This example code is in the public domain. */

#include <WS2812Serial.h>

const int numled = 64;
const int pin = 8;

// Usable pins:
//   Teensy LC:   1, 4, 5, 24
//   Teensy 3.2:  1, 5, 8, 10, 20, 31
//   Teensy 3.5:  1, 5, 8, 10, 20, 26, 32, 33, 48
//   Teensy 3.6:  1, 5, 8, 10, 20, 26, 32, 33

byte drawingMemory[numled*3];         //  3 bytes per LED
DMAMEM byte displayMemory[numled*12]; // 12 bytes per LED

WS2812Serial leds(numled, displayMemory, drawingMemory, pin, WS2812_GRB);

#define RED    0xFF0000
#define GREEN  0x00FF00
#define BLUE   0x0000FF
#define YELLOW 0xFFFF00
#define PINK   0xFF1088
#define ORANGE 0xE05800
#define WHITE  0xFFFFFF

// Less intense...
/*
#define RED    0x160000
#define GREEN  0x001600
#define BLUE   0x000016
#define YELLOW 0x101400
#define PINK   0x120009
#define ORANGE 0x100400
#define WHITE  0x101010
*/

void setup() {
  leds.begin();
}

void loop() {
  // change all the LEDs in 1.5 seconds
  int microsec = 1500000 / leds.numPixels();

  colorWipe(RED, microsec);
  colorWipe(GREEN, microsec);
  colorWipe(BLUE, microsec);
  colorWipe(YELLOW, microsec);
  colorWipe(PINK, microsec);
  colorWipe(ORANGE, microsec);
  colorWipe(WHITE, microsec);
}

void colorWipe(int color, int wait) {
  for (int i=0; i < leds.numPixels(); i++) {
    leds.setPixel(i, color);
    leds.show();
    delayMicroseconds(wait);
  }
}
 
Status
Not open for further replies.
Back
Top