INFO: Dieses Forum nutzt Cookies...
Cookies sind für den Betrieb des Forums unverzichtbar. Mit der Nutzung des Forums erklärst Du dich damit einverstanden, dass wir Cookies verwenden.

Es wird in jedem Fall ein Cookie gesetzt um diesen Hinweis nicht mehr zu erhalten. Desweiteren setzen wir Google Adsense und Google Analytics ein.

Antwort schreiben 
 
Themabewertung:
  • 0 Bewertungen - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
IR- Empfänger für RGBWW LEDs - Feinschliff
25.12.2014, 17:52 (Dieser Beitrag wurde zuletzt bearbeitet: 25.12.2014 18:05 von Thorsten Pferdekämper.)
Beitrag #9
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
(25.12.2014 08:49)MaHa1976 schrieb:  Ich hänge z.b. gern an der Stelle wo es zu entscheiden gilt, ob ich vor oder nach einem Programmabschnitt/Unterprogramm eine Klammer auf oder zu mache...
Also im Prinzip immer dann, wenn der Compiler nicht von alleine "erraten" kann, was zusammengehört. Z.B. nach einem if kann das System ja nicht wissen, bis wohin das "bedingte" Coding geht. Da braucht's dann {}. Am besten lernt man meiner Meinung nach sowas mit vielen Beispielen. Wenn Dir mal unklar ist, warum man irgendwo Klammern braucht, dann frag hier nach. An einem expliziten Beispiel kann man das leichter erklären.
Zitat:also ob das Unterprogramm im Hauptprogramm steht oder allein..
Das, was ich jetzt schreibe ist zwar nicht ganz richtig, aber für den Anfang dürfte es reichen: Unterprogramme (in C++ "Funktionen" genannt) stehen immer für sich selbst. Du definierst keine Funktionen innerhalb anderer Funktionen.
Übrigens: Mit dem Hauptprogramm (in C++ die Funktion "main") haben wir eigentlich gar nichts zu tun. Das wird von der IDE selbst generiert. (Zumindest denke ich mir das so.)
Gruß,
Thorsten

(25.12.2014 09:42)MaHa1976 schrieb:  Ich hab schon hier in der Gegend nach einem Workshop gesucht, keine Chance....
Da müsste man wissen, wo "hier in der Gegend" ist...
Zitat:Ich werde mich mal hinsetzen und was basteln was ich mal hier rein setze zum kommentieren.
Ja, genau.
Zitat:Ich lege für mein Verständnis im Setup für jede LED einen Speicherplatz fest, der die aktuelle Helligkeit speichert und je einen der die aktuell zu setzende Helligkeit speichert.
Im Prinzip ja, nur dass Du die Variablen außerhalb jeglicher Funktion definieren musst, da Du sie global brauchst. Wenn Du die Variablen in setup() definierst, dann kannst Du in anderen Funktionen nicht darauf zugreifen.

Zitat:in der void loop, setze ich vor die Tastenabfrage die fading funktion, letztendlich so ähnlich wie bei dem Beispielsketch "fading without delay"...
Genau so hatte ich es gemeint.

Zitat:Die Tastenabfragen bleiben wie sie sind und rufen die Unterprogrammer auf... theoretisch könnte ich sicher auch hier direkt die Werte die zusetzen sind in den Speicher schreiben lassen.... ich lasse das aber die Unterprogramme machen...., die ihre Position auch nicht änddrn....
So würde ich es auch erstmal machen.

Gruß,
Thorsten

Falls ich mit einer Antwort helfen konnte, wuerde ich mich freuen, ein paar Fotos oder auch ein kleines Filmchen des zugehoerigen Projekts zu sehen.
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
26.12.2014, 10:34
Beitrag #10
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
Dass setup die variablen nicht global zur Verfügung stellt war mir bisher noch nicht klar.... allein die Info von dir könnte schon einige afehler bei anderen Sketchen bei mir erklären... :-) heute Abend setze ich mich mal wieder dran.
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
26.12.2014, 18:26
Beitrag #11
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
also irgendwie klappt es nicht so ganz....

hab das mal mit 2 Tasten und mit rot versucht...

Code:
// http://arduino-direct.com/sunshop/index.php?l=product_detail&p=153
// based on code by Ken Shirriff - http://arcfn.com
// Get Library at: https://github.com/shirriff/Arduino-IRremote

#include "IRremote.h"

int receiver = 11;
IRrecv irrecv(receiver);      
decode_results results;    
int ledrot = 10;
int ledblau = 5;
int ledgruen = 6;
int ledww = 9;
int ledkw = 3;
int fadeAmount = 1;
int brightnessrot = 0;
int brightnessblau = 0;
int brightnessgruen = 0;
int brightnessww = 0;
int brightnesskw = 0;
int brightnessrotneu = 0;
int brightnessblauneu = 0;
int brightnessgruenneu = 0;
int brightnesswwneu = 0;
int brightnesskwneu = 0;

void setup()  
{
  Serial.begin(9600);
  Serial.println("IR Receiver Raw Data + Button Decode Test");
  irrecv.enableIRIn(); // Start the receiver
  pinMode(ledrot, OUTPUT);
  pinMode(ledblau, OUTPUT);
  pinMode(ledgruen, OUTPUT);
  pinMode(ledww, OUTPUT);
  pinMode(ledkw, OUTPUT);

}


void loop()
{
analogWrite(ledrot, brightnessrotneu);

if (brightnessrotneu > brightnessrot && brightnessrotneu == 0 || brightnessrotneu == 255)
{
    brightnessrotneu = brightnessrotneu + fadeAmount;
}  
else if (brightnessrotneu < brightnessrot && brightnessrotneu == 0 || brightnessrotneu == 255)
{
    brightnessrotneu = brightnessrotneu - fadeAmount;  
}
  
  if (irrecv.decode(&results))
  {
    translateIR();
    irrecv.resume();
  }  
}
void translateIR()

{
  switch(results.value)

{
  case 0xFF3AC5:  
    heller();
    Serial.println(" heller            ");
    break;
    
  case 0xFFBA45:  
    dunkler();
    Serial.println(" dunkler             ");
    break;
    
  case 0xFF827D:
    abspielen();
    Serial.println(" abspielen            ");
    break;
    
  case 0xFF02FD:
    anaus();  
    Serial.println(" an/aus           ");
    break;
    
  case 0xFF1AE5:
    rot();  
    Serial.println(" rot           ");
    break;
    
  case 0xFF9A65:  
    gruen();
    Serial.println(" gruen     ");
    break;
    
  case 0xFFA25D:
    blau();
    Serial.println(" blau           ");
    break;
    
  case 0xFF22DD:
    weis();
    Serial.println(" weis           ");
    break;
    
  case 0xFF2AD5:
    rotora();
    Serial.println(" rot-orange             ");
    break;
    
  case 0xFFAA55:  
    tuerkis();
    Serial.println(" tuerkis              ");
    break;
    
  case 0xFF926D:  
    hellblau();
    Serial.println(" hellblau           ");
    break;

  case 0xFF12ED:  
    beige();
    Serial.println(" beige           ");
    break;

  case 0xFF0AF5:  
    gelb();
    Serial.println(" gelb              ");
    break;

  case 0xFF8A75:  
    hellgruen();
    Serial.println(" hellgruen              ");
    break;

  case 0xFFB24D:  
    hellblau();
    Serial.println(" hellblau             ");
    break;

  case 0xFF32CD:
    warmweis();  
    Serial.println(" warmweis              ");
    break;

  case 0xFF38C7:
    dunkelgelb();  
    Serial.println(" dunkelgelb              ");
    break;

  case 0xFFB847:
    blassgruen();
    Serial.println(" blassgruen             ");
    break;

  case 0xFF7887:
    blassblau();
    Serial.println(" blassblau              ");
    break;
    
  case 0xFFF807:
    kaltweis();  
    Serial.println(" kaltweis              ");
    break;

  case 0xFF18E7:
    gelb();  
    Serial.println(" gelblich              ");
    break;

  case 0xFF9867:
    blaugruen();  
    Serial.println(" blau-gruen              ");
    break;

case 0xFF58A7:  
    violett();
    Serial.println(" violett            ");
    break;

  case 0xFFD827:
    blauweis();
    Serial.println(" blau-weis            ");
    break;

  case 0xFF28D7:
    rotplus();
    Serial.println(" rot+            ");
    break;

  case 0xFFA857:
    gruenplus();  
    Serial.println(" gruen+           ");
    break;

  case 0xFF6897:
    blauplus();  
    Serial.println(" blau+           ");
    break;

  case 0xFFE817:
    quick();  
    Serial.println(" quick     ");
    break;

  case 0xFF08F7:
    rotminus();  
    Serial.println(" rot-           ");
    break;

  case 0xFF8877:
    gruenminus();
    Serial.println(" gruen-           ");
    break;

  case 0xFF48B7:
    blauminus();
    Serial.println(" blau-             ");
    break;

  case 0xFFC837:
    slow();
    Serial.println(" slow              ");
    break;

  case 0xFF30CF:  
    DIY1();
    Serial.println(" DIY1           ");
    break;

  case 0xFFB04F:
    DIY2();
    Serial.println(" DIY2           ");
    break;

  case 0xFF708F:
    DIY3();  
    Serial.println(" DIY3              ");
    break;

  case 0xFFF00F:
    autom();  
    Serial.println(" auto              ");
    break;

  case 0xFF10EF:
    DIY4();  
    Serial.println(" DIY4              ");
    break;

  case 0xFF906F:  
    DIY5();
    Serial.println(" DIY5              ");
    break;

  case 0xFF50AF:
    DIY6();  
    Serial.println(" DIY6              ");
    break;

  case 0xFFD02F:
    flash();  
    Serial.println(" flash              ");
    break;

  case 0xFF20DF:
    jump3();  
    Serial.println(" Jump3              ");
    break;

  case 0xFFA05F:
    jump7();  
    Serial.println(" Jump7              ");
    break;

  case 0xFF609F:
    fade3();  
    Serial.println(" Fade3              ");
    break;

  case 0xFFE01F:
    fade7();  
    Serial.println(" Fade7              ");
    break;
    
  case 0xFFFFFFFF:  
    Serial.println(" Taste halten              ");
    break;
    
  default:
    Serial.println(" other button   ");

  }

  delay(50);
  
  
}
void heller()
{
  brightnessrot = 205;
  brightnessgruen = 205;
  brightnessblau = 205;
  brightnessww = 205;
  brightnesskw = 205;
}
  
void dunkler()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 105;
  brightnessww = 105;
  brightnesskw = 105;
}
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
26.12.2014, 20:01
Beitrag #12
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
das faden klappt noch nicht- dafür haben die "+" und "-" Tasten Leben bekommen- da funktioniert allerdings nicht, dass bei min. Helligkeit der Sprung auf max. Helligkeit verhindert wird....

Code:
// http://arduino-direct.com/sunshop/index.php?l=product_detail&p=153
// based on code by Ken Shirriff - http://arcfn.com
// Get Library at: https://github.com/shirriff/Arduino-IRremote

#include "IRremote.h"

int receiver = 11;
IRrecv irrecv(receiver);      
decode_results results;    
int ledrot = 10;
int ledblau = 5;
int ledgruen = 6;
int ledww = 9;
int ledkw = 3;
int fadeAmount = 1;
int brightnessrot = 0;
int brightnessblau = 0;
int brightnessgruen = 0;
int brightnessww = 0;
int brightnesskw = 0;
int brightnessrotneu = 0;
int brightnessblauneu = 0;
int brightnessgruenneu = 0;
int brightnesswwneu = 0;
int brightnesskwneu = 0;

void setup()  
{
  Serial.begin(9600);
  Serial.println("IR Receiver Raw Data + Button Decode Test");
  irrecv.enableIRIn(); // Start the receiver
  pinMode(ledrot, OUTPUT);
  pinMode(ledblau, OUTPUT);
  pinMode(ledgruen, OUTPUT);
  pinMode(ledww, OUTPUT);
  pinMode(ledkw, OUTPUT);

}


void loop()
{
analogWrite(ledrot, brightnessrotneu);
analogWrite(ledgruen, brightnessgruenneu);
analogWrite(ledblau, brightnessblauneu);
analogWrite(ledww, brightnesswwneu);
analogWrite(ledkw, brightnesskwneu);

if (brightnessrotneu >> brightnessrot && brightnessrotneu == 0 || brightnessrotneu == 255)
   {
    brightnessrotneu = brightnessrotneu + fadeAmount;
   }  
else if (brightnessrotneu << brightnessrot && brightnessrotneu == 0 || brightnessrotneu == 255)
   {
    brightnessrotneu = brightnessrotneu - fadeAmount;  
   }
   else
   {
     brightnessrotneu = brightnessrot;
   }

if (brightnessgruenneu > brightnessgruen && brightnessgruenneu == 0 || brightnessgruenneu == 255)
   {
    brightnessgruenneu = brightnessgruenneu + fadeAmount;
   }  
else if (brightnessgruenneu < brightnessgruen && brightnessgruenneu == 0 || brightnessgruenneu == 255)
   {
    brightnessgruenneu = brightnessgruenneu - fadeAmount;  
   }
   else
   {
     brightnessgruenneu = brightnessgruen;
   }

if (brightnessblauneu > brightnessblau && brightnessblauneu == 0 || brightnessblauneu == 255)
   {
    brightnessblauneu = brightnessblauneu + fadeAmount;
   }  
else if (brightnessblauneu < brightnessblau && brightnessblauneu == 0 || brightnessblauneu == 255)
   {
    brightnessblauneu = brightnessblauneu - fadeAmount;  
   }
   else
   {
     brightnessblauneu = brightnessblau;
   }

if (brightnesswwneu > brightnessww && brightnesswwneu == 0 || brightnesswwneu == 255)
   {
    brightnesswwneu = brightnesswwneu + fadeAmount;
   }  
else if (brightnesswwneu < brightnessww && brightnesswwneu == 0 || brightnesswwneu == 255)
   {
    brightnesswwneu = brightnesswwneu - fadeAmount;  
   }
   else
   {
     brightnesswwneu = brightnessww;
   }

if (brightnesskwneu > brightnesskw && brightnesskwneu == 0 || brightnesskwneu == 255)
   {
    brightnesskwneu = brightnesskwneu + fadeAmount;
   }  
else if (brightnesskwneu < brightnesskw && brightnesskwneu == 0 || brightnesskwneu == 255)
   {
    brightnesskwneu = brightnesskwneu - fadeAmount;  
   }
   else
   {
     brightnesskwneu = brightnesskw;
   }  
  
if (irrecv.decode(&results))
  {
    translateIR();
    irrecv.resume();
  }  
}
void translateIR()

{
  switch(results.value)

{
  case 0xFF3AC5:  
    heller();
    Serial.println(" heller            ");
    break;
    
  case 0xFFBA45:  
    dunkler();
    Serial.println(" dunkler             ");
    break;
    
  case 0xFF827D:
    abspielen();
    Serial.println(" abspielen            ");
    break;
    
  case 0xFF02FD:
    anaus();  
    Serial.println(" an/aus           ");
    break;
    
  case 0xFF1AE5:
    rot();  
    Serial.println(" rot           ");
    break;
    
  case 0xFF9A65:  
    gruen();
    Serial.println(" gruen     ");
    break;
    
  case 0xFFA25D:
    blau();
    Serial.println(" blau           ");
    break;
    
  case 0xFF22DD:
    weis();
    Serial.println(" weis           ");
    break;
    
  case 0xFF2AD5:
    rotora();
    Serial.println(" rot-orange             ");
    break;
    
  case 0xFFAA55:  
    tuerkis();
    Serial.println(" tuerkis              ");
    break;
    
  case 0xFF926D:  
    hellblau();
    Serial.println(" hellblau           ");
    break;

  case 0xFF12ED:  
    beige();
    Serial.println(" beige           ");
    break;

  case 0xFF0AF5:  
    gelb();
    Serial.println(" gelb              ");
    break;

  case 0xFF8A75:  
    hellgruen();
    Serial.println(" hellgruen              ");
    break;

  case 0xFFB24D:  
    hellblau();
    Serial.println(" hellblau             ");
    break;

  case 0xFF32CD:
    warmweis();  
    Serial.println(" warmweis              ");
    break;

  case 0xFF38C7:
    dunkelgelb();  
    Serial.println(" dunkelgelb              ");
    break;

  case 0xFFB847:
    blassgruen();
    Serial.println(" blassgruen             ");
    break;

  case 0xFF7887:
    blassblau();
    Serial.println(" blassblau              ");
    break;
    
  case 0xFFF807:
    kaltweis();  
    Serial.println(" kaltweis              ");
    break;

  case 0xFF18E7:
    gelb();  
    Serial.println(" gelblich              ");
    break;

  case 0xFF9867:
    blaugruen();  
    Serial.println(" blau-gruen              ");
    break;

case 0xFF58A7:  
    violett();
    Serial.println(" violett            ");
    break;

  case 0xFFD827:
    blauweis();
    Serial.println(" blau-weis            ");
    break;

  case 0xFF28D7:
    rotplus();
    Serial.println(" rot+            ");
    break;

  case 0xFFA857:
    gruenplus();  
    Serial.println(" gruen+           ");
    break;

  case 0xFF6897:
    blauplus();  
    Serial.println(" blau+           ");
    break;

  case 0xFFE817:
    quick();  
    Serial.println(" quick     ");
    break;

  case 0xFF08F7:
    rotminus();  
    Serial.println(" rot-           ");
    break;

  case 0xFF8877:
    gruenminus();
    Serial.println(" gruen-           ");
    break;

  case 0xFF48B7:
    blauminus();
    Serial.println(" blau-             ");
    break;

  case 0xFFC837:
    slow();
    Serial.println(" slow              ");
    break;

  case 0xFF30CF:  
    DIY1();
    Serial.println(" DIY1           ");
    break;

  case 0xFFB04F:
    DIY2();
    Serial.println(" DIY2           ");
    break;

  case 0xFF708F:
    DIY3();  
    Serial.println(" DIY3              ");
    break;

  case 0xFFF00F:
    autom();  
    Serial.println(" auto              ");
    break;

  case 0xFF10EF:
    DIY4();  
    Serial.println(" DIY4              ");
    break;

  case 0xFF906F:  
    DIY5();
    Serial.println(" DIY5              ");
    break;

  case 0xFF50AF:
    DIY6();  
    Serial.println(" DIY6              ");
    break;

  case 0xFFD02F:
    flash();  
    Serial.println(" flash              ");
    break;

  case 0xFF20DF:
    jump3();  
    Serial.println(" Jump3              ");
    break;

  case 0xFFA05F:
    jump7();  
    Serial.println(" Jump7              ");
    break;

  case 0xFF609F:
    fade3();  
    Serial.println(" Fade3              ");
    break;

  case 0xFFE01F:
    fade7();  
    Serial.println(" Fade7              ");
    break;
    
  case 0xFFFFFFFF:  
    Serial.println(" Taste halten              ");
    break;
    
  default:
    Serial.println(" other button   ");

  }

  delay(50);
  
  
}
void heller()
{
  brightnessrot = brightnessrot + 7;
  brightnessgruen = brightnessgruen + 7;
  brightnessblau = brightnessblau + 7;
  brightnessww = brightnessww + 7;
  brightnesskw = brightnesskw + 7;
}
  
void dunkler()
{
  brightnessrot = brightnessrot - 7;
  brightnessgruen = brightnessgruen - 7;
  brightnessblau = brightnessblau - 7;
  brightnessww = brightnessww - 7;
  brightnesskw = brightnesskw - 7;
}
    
void abspielen()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 55;
  brightnessww = 5;
  brightnesskw = 5;
}

void anaus()
{
  brightnessrot = 5;
  brightnessgruen = 5;
  brightnessblau = 5;
  brightnessww = 5;
  brightnesskw = 5;
}

void rot()
{
  brightnessrot = 255;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void gruen()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}
    
void blau()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void weis()
{
  brightnessrot = 205;
  brightnessgruen = 205;
  brightnessblau = 135;
  brightnessww = 205;
  brightnesskw = 0;
}

void rotora()
{
  brightnessrot = 255;
  brightnessgruen = 85;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void tuerkis()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 155;
  brightnessww = 0;
  brightnesskw = 0;
}

void hellblau()
{
  brightnessrot = 65;
  brightnessgruen = 65;
  brightnessblau = 255;
  brightnessww = 105;
  brightnesskw = 105;
}

void beige()
{
  brightnessrot = 255;
  brightnessgruen = 255;
  brightnessblau = 205;
  brightnessww = 105;
  brightnesskw = 0;
}

void gelb()
{
  brightnessrot = 55;
  brightnessgruen = 45;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void gelblich()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void hellgruen()
{
  brightnessrot = 50;
  brightnessgruen = 255;
  brightnessblau = 20;
  brightnessww = 0;
  brightnesskw = 0;
}

void warmweis()
{
  brightnessrot = 255;
  brightnessgruen = 255;
  brightnessblau = 155;
  brightnessww = 105;
  brightnesskw = 0;
}

void dunkelgelb()
{
  brightnessrot = 70;
  brightnessgruen = 60;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void blassgruen()
{
  brightnessrot = 30;
  brightnessgruen = 205;
  brightnessblau = 20;
  brightnessww = 70;
  brightnesskw = 0;
}

void blassblau()
{
  brightnessrot = 30;
  brightnessgruen = 20;
  brightnessblau = 205;
  brightnessww = 0;
  brightnesskw = 0;
}

void kaltweis()
{
  brightnessrot = 185;
  brightnessgruen = 805;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void blaugruen()
{
  brightnessrot = 205;
  brightnessgruen = 255;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void violett()
{
  brightnessrot = 205;
  brightnessgruen = 0;
  brightnessblau = 205;
  brightnessww = 0;
  brightnesskw = 0;
}

void blauweis()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 205;
  brightnessww = 105;
  brightnesskw = 105;
}

void rotplus()
{
  if (brightnessrot >> 245)
  {
  brightnessrot = brightnessrot + 5;
  }
  else
  {
  brightnessrot = 255;
  }  
}


void gruenplus()
{
  if (brightnessgruen >> 245)
  {
  brightnessgruen = brightnessgruen + 5;
  }
  else
  {
  brightnessgruen = 255;
  }  
}

void blauplus()
{
  if (brightnessblau >> 245)
  {
  brightnessblau = brightnessblau + 5;
  }
  else
  {
  brightnessblau = 255;
  }  
}


void quick()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 105;
  brightnessww = 105;
  brightnesskw = 105;
}

void rotminus()
{
  if (brightnessrot << 10)
  {
  brightnessrot = brightnessrot - 5;
  }
  else
  {
  brightnessrot = 0;
  }  
}

void gruenminus()
{
  if (brightnessgruen << 10)
  {
  brightnessgruen = brightnessgruen - 5;
  }
  else
  {
  brightnessgruen = 0;
  }  
}


void blauminus()
{
  if (brightnessblau << 10)
  {
  brightnessblau = brightnessblau - 5;
  }
  else
  {
  brightnessblau = 1;
  }  
}


void slow()
{
  brightnessrot = 15;
  brightnessgruen = 15;
  brightnessblau = 15;
  brightnessww = 15;
  brightnesskw = 15;
}

void DIY1()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 95;
  brightnesskw = 95;
}

void DIY2()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 75;
  brightnesskw = 75;
}

void DIY3()
{
brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 55;
  brightnesskw = 55;
}

void autom()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 25;
  brightnesskw = 25;
}

void DIY4()
{
  brightnessrot = 75;
  brightnessgruen = 75;
  brightnessblau = 75;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY5()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 55;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY6()
{
  brightnessrot = 35;
  brightnessgruen = 35;
  brightnessblau = 35;
  brightnessww = 0;
  brightnesskw = 0;
}

void flash()
{
brightnessrot = 25;
  brightnessgruen = 25;
  brightnessblau = 25;
  brightnessww = 0;
  brightnesskw = 0;
}

void jump3()
{
  brightnessrot = 75;
  brightnessgruen = 75;
  brightnessblau = 75;
  brightnessww = 75;
  brightnesskw = 75;
}

void jump7()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 55;
  brightnessww = 55;
  brightnesskw = 55;
}

void fade3()
{
   brightnessrot = 35;
  brightnessgruen = 35;
  brightnessblau = 35;
  brightnessww = 35;
  brightnesskw = 35;
}

void fade7()
{
   brightnessrot = 5;
  brightnessgruen = 15;
  brightnessblau = 15;
  brightnessww = 15;
  brightnesskw = 15;
}
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
27.12.2014, 14:25
Beitrag #13
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
hat noch jemand eine Idee bzgl. faden?
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
27.12.2014, 17:19
Beitrag #14
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
so, jetzt funktioniert das Faden wenn ich von einem höheren Wert auf einen niedrigen wechsle, aber nicht wenn ich von einem niedrigen auf einen hohen wechsle- da geht der Wechsel sofort...

Code:
// http://arduino-direct.com/sunshop/index.php?l=product_detail&p=153
// based on code by Ken Shirriff - http://arcfn.com
// Get Library at: https://github.com/shirriff/Arduino-IRremote

#include "IRremote.h"

int receiver = 11;
IRrecv irrecv(receiver);      
decode_results results;    
int ledrot = 10;
int ledblau = 5;
int ledgruen = 6;
int ledww = 9;
int ledkw = 3;
int fadeAmount = 1;
int brightnessrot = 0;
int brightnessblau = 0;
int brightnessgruen = 0;
int brightnessww = 0;
int brightnesskw = 0;
int brightnessrotneu = 0;
int brightnessblauneu = 0;
int brightnessgruenneu = 0;
int brightnesswwneu = 0;
int brightnesskwneu = 0;

void setup()  
{
  Serial.begin(9600);
  Serial.println("IR Receiver Raw Data + Button Decode Test");
  irrecv.enableIRIn(); // Start the receiver
  pinMode(ledrot, OUTPUT);
  pinMode(ledblau, OUTPUT);
  pinMode(ledgruen, OUTPUT);
  pinMode(ledww, OUTPUT);
  pinMode(ledkw, OUTPUT);

}


void loop()
{
analogWrite(ledrot, brightnessrotneu);
analogWrite(ledgruen, brightnessgruenneu);
analogWrite(ledblau, brightnessblauneu);
analogWrite(ledww, brightnesswwneu);
analogWrite(ledkw, brightnesskwneu);

if (brightnessrotneu < brightnessrot)
   {
    brightnessrotneu++ ;
    delay(25);
   }  
if (brightnessrotneu > brightnessrot)
   {
    brightnessrotneu-- ;
   delay(25);
   }
else
   {
     brightnessrotneu = brightnessrot;
   }

if (brightnessgruenneu < brightnessgruen)
   {
    brightnessgruenneu++ ;
    delay(25);
   }  
if (brightnessgruenneu > brightnessgruen)
   {
    brightnessgruenneu-- ;
   delay(25);
   }
else
   {
     brightnessgruenneu = brightnessgruen;
   }
  
   if (brightnessblauneu < brightnessblau)
   {
    brightnessblauneu++ ;
    delay(25);
   }  
if (brightnessblauneu > brightnessrot)
   {
    brightnessblauneu-- ;
   delay(25);
   }
else
   {
     brightnessblauneu = brightnessblau;
   }
  
   if (brightnesswwneu < brightnessww)
   {
    brightnesswwneu++ ;
    delay(25);
   }  
if (brightnesswwneu > brightnessww)
   {
    brightnesswwneu-- ;
   delay(25);
   }
else
   {
     brightnesswwneu = brightnessww;
   }
  
   if (brightnesskwneu < brightnesskw)
   {
    brightnesskwneu++ ;
    delay(25);
   }  
if (brightnesskwneu > brightnesskw)
   {
    brightnesskwneu-- ;
   delay(25);
   }
else
   {
     brightnesskwneu = brightnesskw;
   }
  
  
if (irrecv.decode(&results))
  {
    translateIR();
    irrecv.resume();
  }  
}
void translateIR()

{
  switch(results.value)

{
  case 0xFF3AC5:  
    heller();
    Serial.println(" heller            ");
    break;
    
  case 0xFFBA45:  
    dunkler();
    Serial.println(" dunkler             ");
    break;
    
  case 0xFF827D:
    abspielen();
    Serial.println(" abspielen            ");
    break;
    
  case 0xFF02FD:
    anaus();  
    Serial.println(" an/aus           ");
    break;
    
  case 0xFF1AE5:
    rot();  
    Serial.println(" rot           ");
    break;
    
  case 0xFF9A65:  
    gruen();
    Serial.println(" gruen     ");
    break;
    
  case 0xFFA25D:
    blau();
    Serial.println(" blau           ");
    break;
    
  case 0xFF22DD:
    weis();
    Serial.println(" weis           ");
    break;
    
  case 0xFF2AD5:
    rotora();
    Serial.println(" rot-orange             ");
    break;
    
  case 0xFFAA55:  
    tuerkis();
    Serial.println(" tuerkis              ");
    break;
    
  case 0xFF926D:  
    hellblau();
    Serial.println(" hellblau           ");
    break;

  case 0xFF12ED:  
    beige();
    Serial.println(" beige           ");
    break;

  case 0xFF0AF5:  
    gelb();
    Serial.println(" gelb              ");
    break;

  case 0xFF8A75:  
    hellgruen();
    Serial.println(" hellgruen              ");
    break;

  case 0xFFB24D:  
    hellblau();
    Serial.println(" hellblau             ");
    break;

  case 0xFF32CD:
    warmweis();  
    Serial.println(" warmweis              ");
    break;

  case 0xFF38C7:
    dunkelgelb();  
    Serial.println(" dunkelgelb              ");
    break;

  case 0xFFB847:
    blassgruen();
    Serial.println(" blassgruen             ");
    break;

  case 0xFF7887:
    blassblau();
    Serial.println(" blassblau              ");
    break;
    
  case 0xFFF807:
    kaltweis();  
    Serial.println(" kaltweis              ");
    break;

  case 0xFF18E7:
    gelb();  
    Serial.println(" gelblich              ");
    break;

  case 0xFF9867:
    blaugruen();  
    Serial.println(" blau-gruen              ");
    break;

case 0xFF58A7:  
    violett();
    Serial.println(" violett            ");
    break;

  case 0xFFD827:
    blauweis();
    Serial.println(" blau-weis            ");
    break;

  case 0xFF28D7:
    rotplus();
    Serial.println(" rot+            ");
    break;

  case 0xFFA857:
    gruenplus();  
    Serial.println(" gruen+           ");
    break;

  case 0xFF6897:
    blauplus();  
    Serial.println(" blau+           ");
    break;

  case 0xFFE817:
    quick();  
    Serial.println(" quick     ");
    break;

  case 0xFF08F7:
    rotminus();  
    Serial.println(" rot-           ");
    break;

  case 0xFF8877:
    gruenminus();
    Serial.println(" gruen-           ");
    break;

  case 0xFF48B7:
    blauminus();
    Serial.println(" blau-             ");
    break;

  case 0xFFC837:
    slow();
    Serial.println(" slow              ");
    break;

  case 0xFF30CF:  
    DIY1();
    Serial.println(" DIY1           ");
    break;

  case 0xFFB04F:
    DIY2();
    Serial.println(" DIY2           ");
    break;

  case 0xFF708F:
    DIY3();  
    Serial.println(" DIY3              ");
    break;

  case 0xFFF00F:
    autom();  
    Serial.println(" auto              ");
    break;

  case 0xFF10EF:
    DIY4();  
    Serial.println(" DIY4              ");
    break;

  case 0xFF906F:  
    DIY5();
    Serial.println(" DIY5              ");
    break;

  case 0xFF50AF:
    DIY6();  
    Serial.println(" DIY6              ");
    break;

  case 0xFFD02F:
    flash();  
    Serial.println(" flash              ");
    break;

  case 0xFF20DF:
    jump3();  
    Serial.println(" Jump3              ");
    break;

  case 0xFFA05F:
    jump7();  
    Serial.println(" Jump7              ");
    break;

  case 0xFF609F:
    fade3();  
    Serial.println(" Fade3              ");
    break;

  case 0xFFE01F:
    fade7();  
    Serial.println(" Fade7              ");
    break;
    
  case 0xFFFFFFFF:  
    Serial.println(" Taste halten              ");
    break;
    
  default:
    Serial.println(" other button   ");
    gelb();
    break;
  }

  delay(20);
  
  
}
void heller()
{
  
  if (brightnessrot != 255)
  {
  brightnessrot = brightnessrot + 3;
  }
  else
  {
  brightnessrot = 255;
  }
  
  if (brightnessgruen != 255)
  {
  brightnessgruen = brightnessgruen + 3;
  }
  else
  {
  brightnessgruen = 255;
  }

  if (brightnessblau != 255)
  {
  brightnessblau = brightnessblau + 3;
  }
  else
  {
  brightnessblau = 255;
  }
  
  if (brightnessww != 255)
  {
  brightnessww = brightnessww + 3;
  }
  else
  {
  brightnessww = 255;
  }
  
  if (brightnesskw != 255)
  {
  brightnesskw = brightnesskw + 3;
  }
  else
  {
  brightnesskw = 255;
  }
    
}
  
void dunkler()
{
  if (brightnessrot != 1)
  {
  brightnessrot = brightnessrot - 3;
  }
  else
  {
  brightnessrot = 1;
  }
  
  if (brightnessgruen != 1)
  {
  brightnessgruen = brightnessgruen - 3;
  }
  else
  {
  brightnessgruen = 1;
  }

  if (brightnessblau != 1)
  {
  brightnessblau = brightnessblau - 3;
  }
  else
  {
  brightnessblau = 1;
  }
  
  if (brightnessww != 1)
  {
  brightnessww = brightnessww - 3;
  }
  else
  {
  brightnessww = 1;
  }
  
  if (brightnesskw != 1)
  {
  brightnesskw = brightnesskw - 3;
  }
  else
  {
  brightnesskw = 1;
  }
}
    
void abspielen()
{
  brightnessrot = brightnessrot++;
  brightnessgruen = brightnessrot + 85;
  brightnessblau = brightnessgruen + 85;
  brightnessww = 5;
  brightnesskw = 5;
}

void anaus()
{
  brightnessrot = 5;
  brightnessgruen = 5;
  brightnessblau = 2;
  brightnessww = 5;
  brightnesskw = 5;
}

void rot()
{
  brightnessrot = 255;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void gruen()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}
    
void blau()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void weis()
{
  brightnessrot = 205;
  brightnessgruen = 205;
  brightnessblau = 105;
  brightnessww = 205;
  brightnesskw = 0;
}

void rotora()
{
  brightnessrot = 255;
  brightnessgruen = 65;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void tuerkis()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 125;
  brightnessww = 0;
  brightnesskw = 0;
}

void hellblau()
{
  brightnessrot = 65;
  brightnessgruen = 65;
  brightnessblau = 255;
  brightnessww = 105;
  brightnesskw = 105;
}

void beige()
{
  brightnessrot = 255;
  brightnessgruen = 255;
  brightnessblau = 105;
  brightnessww = 105;
  brightnesskw = 0;
}

void gelb()
{
  brightnessrot = 145;
  brightnessgruen = 75;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void gelblich()
{
  brightnessrot = 75;
  brightnessgruen = 55;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void hellgruen()
{
  brightnessrot = 50;
  brightnessgruen = 255;
  brightnessblau = 20;
  brightnessww = 0;
  brightnesskw = 0;
}

void warmweis()
{
  brightnessrot = 255;
  brightnessgruen = 215;
  brightnessblau = 55;
  brightnessww = 105;
  brightnesskw = 0;
}

void dunkelgelb()
{
  brightnessrot = 70;
  brightnessgruen = 50;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void blassgruen()
{
  brightnessrot = 30;
  brightnessgruen = 205;
  brightnessblau = 20;
  brightnessww = 70;
  brightnesskw = 0;
}

void blassblau()
{
  brightnessrot = 30;
  brightnessgruen = 20;
  brightnessblau = 205;
  brightnessww = 0;
  brightnesskw = 0;
}

void kaltweis()
{
  brightnessrot = 185;
  brightnessgruen = 205;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void blaugruen()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 100;
  brightnessww = 0;
  brightnesskw = 0;
}

void violett()
{
  brightnessrot = 255;
  brightnessgruen = 0;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void blauweis()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 205;
  brightnessww = 0;
  brightnesskw = 105;
}

void rotplus()
{
  if (brightnessrot != 255)
  {
  brightnessrot = brightnessrot + 5;
  }
  else
  {
  brightnessrot = 255;
  }  
}


void gruenplus()
{
  if (brightnessgruen >> 245)
  {
  brightnessgruen = brightnessgruen + 5;
  }
  else
  {
  brightnessgruen = 255;
  }  
}

void blauplus()
{
  if (brightnessblau >> 245)
  {
  brightnessblau = brightnessblau + 5;
  }
  else
  {
  brightnessblau = 255;
  }  
}


void quick()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 105;
  brightnessww = 105;
  brightnesskw = 105;
}

void rotminus()
{
  if (brightnessrot << 10)
  {
  brightnessrot = brightnessrot - 5;
  }
  else
  {
  brightnessrot = 0;
  }  
}

void gruenminus()
{
  if (brightnessgruen << 10)
  {
  brightnessgruen = brightnessgruen - 5;
  }
  else
  {
  brightnessgruen = 0;
  }  
}


void blauminus()
{
  if (brightnessblau << 10)
  {
  brightnessblau = brightnessblau - 5;
  }
  else
  {
  brightnessblau = 1;
  }  
}


void slow()
{
  brightnessrot = 15;
  brightnessgruen = 15;
  brightnessblau = 15;
  brightnessww = 15;
  brightnesskw = 15;
}

void DIY1()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 95;
  brightnesskw = 95;
}

void DIY2()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 75;
  brightnesskw = 75;
}

void DIY3()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 55;
  brightnesskw = 55;
}

void autom()
{
  brightnessrot = brightnessrotneu + 5;
  brightnessgruen = brightnessgruenneu +5;
  brightnessblau = brightnessblauneu +5;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY4()
{
  brightnessrot = 75;
  brightnessgruen = 75;
  brightnessblau = 45;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY5()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 35;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY6()
{
  brightnessrot = 35;
  brightnessgruen = 35;
  brightnessblau = 25;
  brightnessww = 0;
  brightnesskw = 0;
}

void flash()
{
brightnessrot = 25;
  brightnessgruen = 25;
  brightnessblau = 15;
  brightnessww = 0;
  brightnesskw = 0;
}

void jump3()
{
  brightnessrot = 75;
  brightnessgruen = 75;
  brightnessblau = 45;
  brightnessww = 75;
  brightnesskw = 75;
}

void jump7()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 35;
  brightnessww = 55;
  brightnesskw = 55;
}

void fade3()
{
   brightnessrot = 35;
  brightnessgruen = 35;
  brightnessblau = 25;
  brightnessww = 35;
  brightnesskw = 35;
}

void fade7()
{
   brightnessrot = 15;
  brightnessgruen = 15;
  brightnessblau = 5;
  brightnessww = 15;
  brightnesskw = 15;
}
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
27.12.2014, 18:37
Beitrag #15
RE: IR- Empfänger für RGBWW LEDs - Feinschliff
OK, hab den Fehler gefunden...

Alles funktioniert echt perfekt...

wenn jemand noch ein paar coole Ideen hat wie man eine Automatik- Funktion aufrufen kann, nur zu...

wird aber sicher schwierig, dadurch, dass man nur einmal die voids aufruft, um die dort hinterlegten Werte in den Speicher zu schreiben...

Für alle, die es nachbauen wollen hier jetzt der korrekt funktionierende Sketch:

Neben den roten, blauen und grünen LEDs gibt es noch kaltweiße und warmweiße LEDs...

Code:
// http://arduino-direct.com/sunshop/index.php?l=product_detail&p=153
// based on code by Ken Shirriff - http://arcfn.com
// Get Library at: https://github.com/shirriff/Arduino-IRremote

#include "IRremote.h"

int receiver = 11;
IRrecv irrecv(receiver);      
decode_results results;    
int ledrot = 10;
int ledblau = 5;
int ledgruen = 6;
int ledww = 9;
int ledkw = 3;
int fadeAmount = 1;
int brightnessrot = 0;
int brightnessblau = 0;
int brightnessgruen = 0;
int brightnessww = 0;
int brightnesskw = 0;
int brightnessrotneu = 0;
int brightnessblauneu = 0;
int brightnessgruenneu = 0;
int brightnesswwneu = 0;
int brightnesskwneu = 0;

void setup()  
{
  Serial.begin(9600);
  Serial.println("IR Receiver Raw Data + Button Decode Test");
  irrecv.enableIRIn(); // Start the receiver
  pinMode(ledrot, OUTPUT);
  pinMode(ledblau, OUTPUT);
  pinMode(ledgruen, OUTPUT);
  pinMode(ledww, OUTPUT);
  pinMode(ledkw, OUTPUT);

}


void loop()
{
analogWrite(ledrot, brightnessrotneu);
analogWrite(ledgruen, brightnessgruenneu);
analogWrite(ledblau, brightnessblauneu);
analogWrite(ledww, brightnesswwneu);
analogWrite(ledkw, brightnesskwneu);

if (brightnessrotneu < brightnessrot)
   {
    brightnessrotneu++ ;
    delay(10);
   }  
else if (brightnessrotneu > brightnessrot)
   {
    brightnessrotneu-- ;
   delay(10);
   }
else
   {
     brightnessrotneu = brightnessrot;
   }

if (brightnessgruenneu < brightnessgruen)
   {
    brightnessgruenneu++ ;
    delay(10);
   }  
else if (brightnessgruenneu > brightnessgruen)
   {
    brightnessgruenneu-- ;
   delay(10);
   }
else
   {
     brightnessgruenneu = brightnessgruen;
   }
  
if (brightnessblauneu < brightnessblau)
   {
    brightnessblauneu++ ;
    delay(10);
   }  
else if (brightnessblauneu > brightnessblau)
   {
    brightnessblauneu-- ;
   delay(10);
   }
else
   {
     brightnessblauneu = brightnessblau;
   }
  
if (brightnesswwneu < brightnessww)
   {
    brightnesswwneu++ ;
    delay(10);
   }  
else if (brightnesswwneu > brightnessww)
   {
    brightnesswwneu-- ;
   delay(10);
   }
else
   {
     brightnesswwneu = brightnessww;
   }
  
if (brightnesskwneu < brightnesskw)
   {
    brightnesskwneu++ ;
    delay(10);
   }  
else if (brightnesskwneu > brightnesskw)
   {
    brightnesskwneu-- ;
   delay(10);
   }
else
   {
     brightnesskwneu = brightnesskw;
   }
  
  
if (irrecv.decode(&results))
  {
    translateIR();
    irrecv.resume();
  }  
}
void translateIR()

{
  switch(results.value)

{
  case 0xFF3AC5:  
    heller();
    Serial.println(" heller            ");
    break;
    
  case 0xFFBA45:  
    dunkler();
    Serial.println(" dunkler             ");
    break;
    
  case 0xFF827D:
    abspielen();
    Serial.println(" abspielen            ");
    break;
    
  case 0xFF02FD:
    anaus();  
    Serial.println(" an/aus           ");
    break;
    
  case 0xFF1AE5:
    rot();  
    Serial.println(" rot           ");
    break;
    
  case 0xFF9A65:  
    gruen();
    Serial.println(" gruen     ");
    break;
    
  case 0xFFA25D:
    blau();
    Serial.println(" blau           ");
    break;
    
  case 0xFF22DD:
    weis();
    Serial.println(" weis           ");
    break;
    
  case 0xFF2AD5:
    rotora();
    Serial.println(" rot-orange             ");
    break;
    
  case 0xFFAA55:  
    tuerkis();
    Serial.println(" tuerkis              ");
    break;
    
  case 0xFF926D:  
    hellblau();
    Serial.println(" hellblau           ");
    break;

  case 0xFF12ED:  
    beige();
    Serial.println(" beige           ");
    break;

  case 0xFF0AF5:  
    gelb();
    Serial.println(" gelb              ");
    break;

  case 0xFF8A75:  
    hellgruen();
    Serial.println(" hellgruen              ");
    break;

  case 0xFFB24D:  
    hellblau();
    Serial.println(" hellblau             ");
    break;

  case 0xFF32CD:
    warmweis();  
    Serial.println(" warmweis              ");
    break;

  case 0xFF38C7:
    dunkelgelb();  
    Serial.println(" dunkelgelb              ");
    break;

  case 0xFFB847:
    blassgruen();
    Serial.println(" blassgruen             ");
    break;

  case 0xFF7887:
    blassblau();
    Serial.println(" blassblau              ");
    break;
    
  case 0xFFF807:
    kaltweis();  
    Serial.println(" kaltweis              ");
    break;

  case 0xFF18E7:
    gelb();  
    Serial.println(" gelblich              ");
    break;

  case 0xFF9867:
    blaugruen();  
    Serial.println(" blau-gruen              ");
    break;

case 0xFF58A7:  
    violett();
    Serial.println(" violett            ");
    break;

  case 0xFFD827:
    blauweis();
    Serial.println(" blau-weis            ");
    break;

  case 0xFF28D7:
    rotplus();
    Serial.println(" rot+            ");
    break;

  case 0xFFA857:
    gruenplus();  
    Serial.println(" gruen+           ");
    break;

  case 0xFF6897:
    blauplus();  
    Serial.println(" blau+           ");
    break;

  case 0xFFE817:
    quick();  
    Serial.println(" quick     ");
    break;

  case 0xFF08F7:
    rotminus();  
    Serial.println(" rot-           ");
    break;

  case 0xFF8877:
    gruenminus();
    Serial.println(" gruen-           ");
    break;

  case 0xFF48B7:
    blauminus();
    Serial.println(" blau-             ");
    break;

  case 0xFFC837:
    slow();
    Serial.println(" slow              ");
    break;

  case 0xFF30CF:  
    DIY1();
    Serial.println(" DIY1           ");
    break;

  case 0xFFB04F:
    DIY2();
    Serial.println(" DIY2           ");
    break;

  case 0xFF708F:
    DIY3();  
    Serial.println(" DIY3              ");
    break;

  case 0xFFF00F:
    autom();  
    Serial.println(" auto              ");
    break;

  case 0xFF10EF:
    DIY4();  
    Serial.println(" DIY4              ");
    break;

  case 0xFF906F:  
    DIY5();
    Serial.println(" DIY5              ");
    break;

  case 0xFF50AF:
    DIY6();  
    Serial.println(" DIY6              ");
    break;

  case 0xFFD02F:
    flash();  
    Serial.println(" flash              ");
    break;

  case 0xFF20DF:
    jump3();  
    Serial.println(" Jump3              ");
    break;

  case 0xFFA05F:
    jump7();  
    Serial.println(" Jump7              ");
    break;

  case 0xFF609F:
    fade3();  
    Serial.println(" Fade3              ");
    break;

  case 0xFFE01F:
    fade7();  
    Serial.println(" Fade7              ");
    break;
    
  case 0xFFFFFFFF:  
    Serial.println(" Taste halten              ");
    break;
    
  default:
    Serial.println(" other button   ");
  }

  delay(20);
}

void heller()
{
  
  if (brightnessrot != 255)
  {
  brightnessrot = brightnessrot + 3;
  }
  else
  {
  brightnessrot = 255;
  }
  
  if (brightnessgruen != 255)
  {
  brightnessgruen = brightnessgruen + 3;
  }
  else
  {
  brightnessgruen = 255;
  }

  if (brightnessblau != 255)
  {
  brightnessblau = brightnessblau + 3;
  }
  else
  {
  brightnessblau = 255;
  }
  
  if (brightnessww != 255)
  {
  brightnessww = brightnessww + 3;
  }
  else
  {
  brightnessww = 255;
  }
  
  if (brightnesskw != 255)
  {
  brightnesskw = brightnesskw + 3;
  }
  else
  {
  brightnesskw = 255;
  }
    
}
  
void dunkler()
{
  if (brightnessrot > 3)
  {
  brightnessrot = brightnessrot - 3;
  }
  else
  {
  brightnessrot = 1;
  }
  
  if (brightnessgruen > 3)
  {
  brightnessgruen = brightnessgruen - 3;
  }
  else
  {
  brightnessgruen = 1;
  }

  if (brightnessblau > 3)
  {
  brightnessblau = brightnessblau - 3;
  }
  else
  {
  brightnessblau = 1;
  }
  
  if (brightnessww > 3)
  {
  brightnessww = brightnessww - 3;
  }
  else
  {
  brightnessww = 1;
  }
  
  if (brightnesskw > 3)
  {
  brightnesskw = brightnesskw - 3;
  }
  else
  {
  brightnesskw = 1;
  }
}
    
void abspielen()
{
  brightnessrot = brightnessrot++;
  brightnessgruen = brightnessrot + 85;
  brightnessblau = brightnessgruen + 85;
  brightnessww = 5;
  brightnesskw = 5;
}

void anaus()
{
  brightnessrot = 1;
  brightnessgruen = 1;
  brightnessblau = 1;
  brightnessww = 1;
  brightnesskw = 1;
}

void rot()
{
  brightnessrot = 255;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void gruen()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}
    
void blau()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void weis()
{
  brightnessrot = 205;
  brightnessgruen = 205;
  brightnessblau = 105;
  brightnessww = 205;
  brightnesskw = 0;
}

void rotora()
{
  brightnessrot = 255;
  brightnessgruen = 65;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void tuerkis()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 125;
  brightnessww = 0;
  brightnesskw = 0;
}

void hellblau()
{
  brightnessrot = 0;
  brightnessgruen = 165;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void beige()
{
  brightnessrot = 215;
  brightnessgruen = 205;
  brightnessblau = 15;
  brightnessww = 45;
  brightnesskw = 0;
}

void gelb()
{
  brightnessrot = 145;
  brightnessgruen = 75;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void gelblich()
{
  brightnessrot = 75;
  brightnessgruen = 55;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void hellgruen()
{
  brightnessrot = 0;
  brightnessgruen = 205;
  brightnessblau = 20;
  brightnessww = 0;
  brightnesskw = 0;
}

void warmweis()
{
  brightnessrot = 255;
  brightnessgruen = 215;
  brightnessblau = 55;
  brightnessww = 105;
  brightnesskw = 0;
}

void dunkelgelb()
{
  brightnessrot = 70;
  brightnessgruen = 40;
  brightnessblau = 0;
  brightnessww = 0;
  brightnesskw = 0;
}

void blassgruen()
{
  brightnessrot = 15;
  brightnessgruen = 175;
  brightnessblau = 5;
  brightnessww = 0;
  brightnesskw = 0;
}

void blassblau()
{
  brightnessrot = 55;
  brightnessgruen = 0;
  brightnessblau = 45;
  brightnessww = 0;
  brightnesskw = 0;
}

void kaltweis()
{
  brightnessrot = 185;
  brightnessgruen = 205;
  brightnessblau = 255;
  brightnessww = 0;
  brightnesskw = 0;
}

void blaugruen()
{
  brightnessrot = 0;
  brightnessgruen = 255;
  brightnessblau = 100;
  brightnessww = 0;
  brightnesskw = 0;
}

void violett()
{
  brightnessrot = 255;
  brightnessgruen = 0;
  brightnessblau = 235;
  brightnessww = 0;
  brightnesskw = 0;
}

void blauweis()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 205;
  brightnessww = 0;
  brightnesskw = 105;
}

void rotplus()
{
  if (brightnessrot != 255)
  {
  brightnessrot = brightnessrot + 5;
  }
  else
  {
  brightnessrot = 255;
  }  
}


void gruenplus()
{
  if (brightnessgruen != 255)
  {
  brightnessgruen = brightnessgruen + 5;
  }
  else
  {
  brightnessgruen = 255;
  }  
}

void blauplus()
{
  if (brightnessblau != 255)
  {
  brightnessblau = brightnessblau + 5;
  }
  else
  {
  brightnessblau = 255;
  }  
}


void quick()
{
  brightnessrot = 105;
  brightnessgruen = 105;
  brightnessblau = 105;
  brightnessww = 105;
  brightnesskw = 105;
}

void rotminus()
{
  if (brightnessrot > 6)
  {
  brightnessrot = brightnessrot - 5;
  }
  else
  {
  brightnessrot = 1;
  }
}

void gruenminus()
{
  if (brightnessgruen > 6)
  {
  brightnessgruen = brightnessgruen - 5;
  }
  else
  {
  brightnessgruen = 1;
  }
}

void blauminus()
{
  if (brightnessblau > 6)
  {
  brightnessblau = brightnessblau - 5;
  }
  else
  {
  brightnessblau = 1;
  }
}

void slow()
{
  brightnessrot = 15;
  brightnessgruen = 15;
  brightnessblau = 15;
  brightnessww = 15;
  brightnesskw = 15;
}

void DIY1()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 95;
  brightnesskw = 95;
}

void DIY2()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 75;
  brightnesskw = 75;
}

void DIY3()
{
  brightnessrot = 0;
  brightnessgruen = 0;
  brightnessblau = 0;
  brightnessww = 55;
  brightnesskw = 55;
}

void autom()
{
  brightnessrot = brightnessrotneu + 5;
  brightnessgruen = brightnessgruenneu +5;
  brightnessblau = brightnessblauneu +5;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY4()
{
  brightnessrot = 75;
  brightnessgruen = 75;
  brightnessblau = 45;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY5()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 35;
  brightnessww = 0;
  brightnesskw = 0;
}

void DIY6()
{
  brightnessrot = 35;
  brightnessgruen = 35;
  brightnessblau = 25;
  brightnessww = 0;
  brightnesskw = 0;
}

void flash()
{
brightnessrot = 25;
  brightnessgruen = 25;
  brightnessblau = 15;
  brightnessww = 0;
  brightnesskw = 0;
}

void jump3()
{
  brightnessrot = 75;
  brightnessgruen = 75;
  brightnessblau = 45;
  brightnessww = 75;
  brightnesskw = 75;
}

void jump7()
{
  brightnessrot = 55;
  brightnessgruen = 55;
  brightnessblau = 35;
  brightnessww = 55;
  brightnesskw = 55;
}

void fade3()
{
   brightnessrot = 35;
  brightnessgruen = 35;
  brightnessblau = 25;
  brightnessww = 35;
  brightnesskw = 35;
}

void fade7()
{
   brightnessrot = 15;
  brightnessgruen = 15;
  brightnessblau = 5;
  brightnessww = 15;
  brightnesskw = 15;
}
Alle Beiträge dieses Benutzers finden
Diese Nachricht in einer Antwort zitieren
Antwort schreiben 


Möglicherweise verwandte Themen...
Thema: Verfasser Antworten: Ansichten: Letzter Beitrag
  Arduino Mini Pro mit RCSwich und 433MHz Empfänger OLDARDUINO 6 263 03.11.2016 14:43
Letzter Beitrag: hotsystems
  433Mhz Fernbedienung Empfänger Haustechno 5 1.982 21.11.2015 17:06
Letzter Beitrag: hotsystems
  32 leistungsstarke LEDs mit Arduino steuern velophile 14 3.037 30.10.2015 16:33
Letzter Beitrag: hotsystems
  2 LEDs über serielle Schnittstelle steuern Bill 0 1.010 13.08.2015 16:04
Letzter Beitrag: Bill
Lightbulb Hexacopter LED mit RC Empfänger und WS2812B LED Wampo 9 3.369 02.01.2015 14:17
Letzter Beitrag: Wampo
  RC-Empfänger PWM-Signale für Servoansteuerung einlesen do1xxy 2 4.146 15.07.2014 21:32
Letzter Beitrag: do1xxy

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste