Programacion de tira led Tira LED WS2812B

Hola soy nuevo en esto de Arduino y estoy replicando un proyecto de un marcador y reloj de basquetbol que alguien ya hizo y compartió todo bien ya hice funcionar el proyecto pero quiero incrementar el numero de leds que forman los números.
los números están formados con Tira LED WS2812B y cada segmento esta formado por 2 led. Quiero incrementarlos a 5 leds por segmento y tengo 2 problemas

1 incremento el numero de led en la programación de fastled y al compilar me marca error de memora en el Arduino One que estoy usando.

hice prueba con menos led y si compila pero no encienden mas de 140 led, que son los que están declarados con el circuito original.

Soy novato programando en Arduino y no encuentro como programar para que me enciendan mas led...

Agradeceré su ayuda

Título editado por Moderador
De acuerdo a punto 5 de las normas del foro.

Moderador
Ya edité tu título por poner "Ayuda con..." eso se considera un título inútil porque el foro es de ayuda.
Ahora lee las Normas del foro y publica/edita tu código/error usando etiquetas de código.
Publica tmb el link de donde viste el video/tutorial.
Siempre aporta toda la informacón.

  1. ¿Cuántos LED vas a utilizar?
  2. ¿Estás energizando directamente la tira LED desde el Arduino?

Un UNO tiene poca RAM y 140 bytes llevan al UNO que solo tiene 2k al limite.
Usa otro arduino.
Puedes usar un Atmega32u4 o sea un Pro Micro, es barato y tiene mas RAM y Flash que el UNO.

Ayuda con programación de tira led Tira LED WS2812

subo el código:

#include <FastLED.h>
#define LED_PIN 3
#define NUM_LEDS 140
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

const int buzzerPin = 4;

RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";

CRGB leds[NUM_LEDS];

boolean horn = false;
int times = 0;

int charLayout[11][14] = {
{0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, //0
{0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}, //1
{1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1}, //2
{1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1}, //3
{1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1}, //4
{1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0}, //5
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0}, //6
{0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}, //7
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, //8
{1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1}, //9
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} //CLR
} ;

//does not include the 1 in third score digit and colon and bonus / poss
int offset[] = {0, 14, 30, 44, 62, 76, 92, 112, 126};

void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);

Serial.begin(9600);

radio.begin();
radio.openReadingPipe(0, address);
radio.setPALevel(RF24_PA_MIN);
radio.startListening();

pinMode(buzzerPin, OUTPUT);

clearScreen();

//Draw colon
leds[28] = CRGB(255, 120, 0);
leds[29] = CRGB(255, 120, 0);
}

void drawChar(int number, int offsetY, String color) {
for (int i = 0; i <= 13; i++) {
if(charLayout[number][i] == 1) {//chose num
if(color == "red") {
leds[i + offset[offsetY]] = CRGB (220, 0, 0);
}else if(color == "yellow") {
leds[i + offset[offsetY]] = CRGB (255, 120, 0);
}
}else {
leds[i + offset[offsetY]] = CRGB (0, 0, 0);
}
}
}

void drawOther(String item) {
if(item == "hOne") {
for(int i = 58; i <= 61; i++) {
leds[i] = CRGB(220, 0, 0);
}

}else if(item == "hClear") {
for(int i = 58; i <= 61; i++) {
leds[i] = CRGB(0, 0, 0);
}

}else if(item == "gOne") {
for(int i = 108; i <= 111; i++) {
leds[i] = CRGB(220, 0, 0);
}

}else if(item == "gClear") {
for(int i = 108; i <= 111; i++) {
leds[i] = CRGB(0, 0, 0);
}
}

}

void clearScreen() {
for (int i = 0; i <= 139; i++) {
leds[i] = CRGB(0, 0, 0);
}
FastLED.show();
}

void loop() {
if(times >= 10) {
horn = false;
times = 0;
}else{
times++;
}

Serial.println(times);

if (radio.available()) {
char clk[32] = "";
radio.read(&clk, sizeof(clk));

if(String(clk[0]) == "t") {
  if((clk[1] - 0) - '0' != 0) {
    drawChar((clk[1] - 0) - '0', 0, "yellow");
  }else{
    drawChar(10, 0, "");
  }
  drawChar((clk[2] - 0) - '0', 1, "yellow");
  drawChar((clk[4] - 0) - '0', 2, "yellow");
  drawChar((clk[5] - 0) - '0', 3, "yellow");
  
  FastLED.show();
  
}

if(String(clk[0]) == "h") {
  if((clk[1] - 0) - '0' != 0) {
    drawOther("hOne");
  }else{
    drawOther("hClear");
  }
  
  if(((clk[2] - 0) - '0' == 0) && ((clk[1] - 0) - '0' == 0)) {
    drawChar(10, 4, "");
    
  }else{
    drawChar((clk[2] - 0) - '0', 4, "red");
  }
  
  drawChar((clk[3] - 0) - '0', 5, "red");
  
  FastLED.show();
}

if(String(clk[0]) == "g") {
  if((clk[1] - 0) - '0' != 0) {
    drawOther("gOne");
  }else{
    drawOther("gClear");
  }
  
  if(((clk[2] - 0) - '0' == 0) && ((clk[1] - 0) - '0' == 0)) {
    drawChar(10, 7, "");
    
  }else{
    drawChar((clk[2] - 0) - '0', 7, "red");
  }
  
  drawChar((clk[3] - 0) - '0', 8, "red");
  
  FastLED.show();
}

if(String(clk[0]) == "p") {
  drawChar((clk[1] - 0) - '0', 6, "yellow");
  
  FastLED.show();
}

if(String(clk[0]) == "a") { //home bonus
  if((clk[1] - 0) - '0' == 1) {
    leds[90] = CRGB(255, 120, 0);
  }else{
    leds[90] = CRGB(0, 0, 0);
  }

  FastLED.show();
}

if(String(clk[0]) == "b") { //guest bonus
  if((clk[1] - 0) - '0' == 1) {
    leds[106] = CRGB(255, 120, 0);
  }else{
    leds[106] = CRGB(0, 0, 0);
  }

  FastLED.show();
}

if(String(clk[0]) == "c" ) { //home poss
  if((clk[1] - 0) - '0' == 1) {
    leds[91] = CRGB(220, 0, 0);
  }else{
    leds[91] = CRGB(0, 0, 0);
  }

  FastLED.show();
}

if(String(clk[0]) == "d") { //guest poss
  if((clk[1] - 0) - '0' == 1) {
    leds[107] = CRGB(220, 0, 0);
  }else{
    leds[107] = CRGB(0, 0, 0);
  }

  FastLED.show();
}

if(String(clk[0]) == "o") {
  horn = true;
  times = 0;
}else{
  horn = false;
}

}

Serial.println(horn);

if(horn == true) {
digitalWrite(buzzerPin, HIGH);
}else{
digitalWrite(buzzerPin, LOW);
}
}

pretendo usar 350

los alimento con otra fuente de 5v 20a

gracias tienes razon

Moderador
Te pedí que leyeras las normas del foro y posteas mal tu código?
Edita usando etiquetas.
Mira otros temas y entenderás.
No te pido que lo vuelvas a postear, te pido que lo edites.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.