Color was not declared in this scope

Me ayudan con este error? Estoy empezando. Gracias de antemano por su apoyo.

int value;
int pinR = 11;
int pinG = 10;
int pinB = 9;

void setup() {
pinMode(A0, INPUT);
pinMode(pinR, OUTPUT);
pinMode(pinG, OUTPUT);
pinMode(pinB, OUTPUT);

}

void loop() {
value = analogRead(A0);
if(value <= 300){
c = strip.Color(255,0,0);
}
if(value >= 300)
{
c = strip.Color(0,255,0);
delay(100);
c = strip.Color(0,0,255);
delay(100);
}

}

void color(int R, int G, int B)
{

analogWrite(pinR, R);
analogWrite(pinG, G);
analogWrite(pinB, B);

}

Hi @mikepuch ,
Welcome to the forum..
Looks like you still have something left over from when you were using some led library, strip is an undefined object..
kind of looks like you want to use your own color function..
maybe like this..

int value;
int pinR = 11;
int pinG = 10;
int pinB = 9;

void setup() {
  pinMode(A0, INPUT);
  pinMode(pinR, OUTPUT);
  pinMode(pinG, OUTPUT);
  pinMode(pinB, OUTPUT);

}

void loop() {
  value = analogRead(A0);
  if (value <= 300) {
    color(255, 0, 0);
  }
  if (value >= 300)
  {
    color(0, 255, 0);
    delay(100);
    color(0, 0, 255);
    delay(100);
  }

}

void color(int R, int G, int B)
{

  analogWrite(pinR, R);
  analogWrite(pinG, G);
  analogWrite(pinB, B);

}

Uno RGB Led Pot Control..

good luck.. ~q

He trasladado su tema de una categoría de idioma inglés del foro a la categoría International > Español @mikepuch.

En adelante por favor usar la categoría apropiada a la lengua en que queráis publicar. Esto es importante para el uso responsable del foro, y esta explicado aquí la guía "How to get the best out of this forum".
Este guía contiene mucha información útil. Por favor leer.

De antemano, muchas gracias por cooperar.

Por favor, edita tu post inicial. Los errores no se postean con capturas.

Moderador:
Por favor, lee las Normas del foro y edita tu código/error usando etiquetas de código.
Ve a edición, luego selecciona todo el código que has publicado, lo cortas y click en (<CODE/>)


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