W sprawie Ambient light

Problemy z realizacją projektów prezentowanych na blogu.
ODPOWIEDZ
jancenty
Młodszy majsterkowicz
Posty: 9
Rejestracja: 11 lut 2017, 18:11

W sprawie Ambient light

Post autor: jancenty » 23 lut 2017, 14:10

Witam
Ostatnio zmontowałem układ https://majsterkowo.pl/ambient-light-dy ... go-ekranu/ niestety ale co jakiś czas mruga niebieskim kolorem, z tego co czytałem w komentarzach wynika to ze zbyt wolnego odświeżania SoftPwm, jedna z osób znalazła prawie idealne rozwiązanie, jest nią zainstalowanie alternatywnego programu UnoLight.
Niestety po wgraniu i zaimportowaniu tej biblioteki wywala błąd:

Kod: Zaznacz cały

In file included from sketch_feb23a.ino:2:
C:\Users\User\Documents\Arduino\libraries\UnoLight/gammaTable.h:14: error: 'word' does not name a type In file included from sketch_feb23a.ino:3:
C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:72: error: 'word' does not name a type
C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:73: error: 'word' does not name a type
C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:74: error: 'boolean' does not name a type In file included from sketch_feb23a.ino:5:
C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:6: error: 'byte' does not name a type
C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:16: error: 'byte' does not name a type
C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:17: error: 'millis' was not declared in this scope In file included from sketch_feb23a.ino:6: 
C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:5: error: 'byte' does not name a type
C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:7: error: expected initializer before '*' token
C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:8: error: expected initializer before '*' token
C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:9: error: expected initializer before '*' token
C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:10: error: expected initializer before '*' token In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:17,                  from sketch_feb23a.ino:7:
C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:17: error: redefinition of 'long unsigned int timeOfLastTransmition'
C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:17: error: 'long unsigned int timeOfLastTransmition' previously defined here
Co może być przyczyną tego błędu?? Nie znam się na programowaniu, jeśli ktoś zna odpowiedź proszę o pomoc :)

Co miesiąc do wygrania nagrody o wartości ponad 1600 zł!


Arturr300
Starszy majsterkowicz
Posty: 307
Rejestracja: 16 paź 2013, 17:24

Re: W sprawie Ambient light

Post autor: Arturr300 » 26 lut 2017, 23:59

Wrzuć kod programu.
jancenty
Młodszy majsterkowicz
Posty: 9
Rejestracja: 11 lut 2017, 18:11

Re: W sprawie Ambient light

Post autor: jancenty » 28 lut 2017, 09:52

Kod: Zaznacz cały

#include <arduinoPins2Ports.h>
#include <gammaTable.h>
#include <leds.h>
#include <macros.h>
#include <serialCommunication.h>
#include <settings.h>
#include <UnoLight.h>

#include <SoftPWM.h>

#define C_SF1 0xF1 // Startflag for 1-channel mode (1 RGB channel)
#define C_SF2 0xF2 // Startflag for 2-channel mode (2 RGB channels)
#define C_SF3 0xF3 // Startflag for 3-channel mode (3 RGB channels)
#define C_SF4 0xF4 // Startflag for 4-channel mode (4 RGB channels)
#define C_END 0x33 // End flag
#define C_ESC 0x99 // Escape character

// States for receiving the information, see the flow chart for more info
#define S_WAIT_FOR_SF  0
#define S_RECV_RGB     1
#define S_RECV_RGB_ESC 2

#define COLORS_TAB_SIZE 10

//---------------------------------------------------------------------------
//--------------------------- FUNCTION DECLARATIONS -------------------------
//---------------------------------------------------------------------------

void ReadButtons();

void SetColors(int color); 

// Receives bytes and returns true if a valid packet was received
boolean PacketReceived();

// Uses the rgb values to set the PWMs
void SetPWMs();

//---------------------------------------------------------------------------
//--------------------------- VARIABLE DECLARATIONS -------------------------
//---------------------------------------------------------------------------

int pulse = 0;

// State we are in: one of the S_* defines
int State = 0;
// The payload of a received message
int Payload[32];
// The amount of RGB values we have received
int ByteCount = 0;
// The character we received
int Recv;

// The amount of RGB channels we are using
int ChannelMode;

// The value for easing (lower is more)
// For more easing adjust the delay in loop()
int easing = 1;

// PWM pins for channel 1
int r1_pin = 3;
int g1_pin = 2;
int b1_pin = 4;

// PWM pins for channel 2
int r2_pin = 6;
int g2_pin = 5;
int b2_pin = 7;

// PWM pins for channel 3
int r3_pin = 9;
int g3_pin = 8;
int b3_pin = 10;

// PWM pins for channel 4
int r4_pin = 12;
int g4_pin = 11;
int b4_pin = 13;

// Current PWM output values (as opposed to target output values)
int r1_current = 0;
int g1_current = 0;
int b1_current = 0;
int r2_current = 0;
int g2_current = 0;
int b2_current = 0;
int r3_current = 0;
int g3_current = 0;
int b3_current = 0;
int r4_current = 0;
int g4_current = 0;
int b4_current = 0;

int button1_pin = A5;
int button2_pin = A4;
int button3_pin = A3;
int button4_pin = A2;

int menu_position = 0;
int menu_color = COLORS_TAB_SIZE-1;

int brightness = 80; // 0-100

int colors_tab[COLORS_TAB_SIZE][12]={
                      {255,0,0,        255,0,0,      255,0,0,      255,0,0,},          // czerwony 
                      {255,255,255,      255,255,255,    255,255,255,    255,255,255}, // bialy
                      {0,0,255,      0,0,255,      0,0,255,        0,0,255},           // niebieski
                      {0,255,0,    0,255,0,    0,255,0,    0,255,0},                   // zielony
                      {255,69,0,    255,69,0,   255,69,0,   255,69,0},                 // pomaranczowo-czerwony
                      {255,140,0,     255,140,0,     255,140,0,     255,140,0},        // ciemny pomaranczowy
                      {255,180,0,      255,180,0,      255,180,0,      255,180,0},     // zolty
                      {127,255,0,      127,255,0,      127,255,0,      127,255,0},     // jasny zielony
                      {50,50,224,      50,50,224,      50,50,224,      50,50,224},     // granat
                      {255,20,147,      255,20,147,      255,20,147,      255,20,147}  // gleboki różowy :D
};

//---------------------------------------------------------------------------
//----------------------------- IMPLEMENTATIONS -----------------------------
//---------------------------------------------------------------------------

void setup()   {                
  // initialize the serial communication
  Serial.begin(256000);	// opens serial port, sets data rate to 256000 bps

  TCCR0B = TCCR0B & 0b11111000 | 0x2;
  TCCR1B = TCCR0B & 0b11111000 | 0x2;
  TCCR2B = TCCR0B & 0b11111000 | 0x2;

  State = S_WAIT_FOR_SF;

  pinMode(button1_pin, INPUT_PULLUP);
  pinMode(button2_pin, INPUT_PULLUP);
  pinMode(button3_pin, INPUT_PULLUP);
  pinMode(button4_pin, INPUT_PULLUP);  

  SoftPWMBegin();
}
//---------------------------------------------------------------------------

void loop()                     
{
  ReadButtons();
  if(menu_position == 0){
    if (Serial.available() > 0) {
      PacketReceived();
    }
  }
  else if(menu_position == 1){
    SetColors(menu_color); 
  }

  SetPWMs();
  delay(10);

}
//---------------------------------------------------------------------------

void ReadButtons() {
  // odbieraj sygnal z komputera
  if(digitalRead(button1_pin)==LOW) {
    menu_position = 0;
    delay(4000);
  }

  // stale kolory -> następny kolor
  if(digitalRead(button2_pin)==LOW) {
    menu_position = 1;
    if(menu_color >= (COLORS_TAB_SIZE-1) ) menu_color = 0;
    else menu_color++;
    delay(4000);
  }

  // jasniej
  if(digitalRead(button3_pin)==LOW) { 
    menu_position = 1;
    if(brightness < 20) brightness -= 5;
    else brightness -= 20;
    if(brightness < 1) brightness = 1;
    delay(1000);
  }

  if(digitalRead(button4_pin)==LOW) {
    menu_position = 1;
    if(brightness < 20) brightness += 5;
    else brightness += 20;
    if(brightness > 100) brightness = 100;
    delay(1000);
  } 

}
//---------------------------------------------------------------------------

void SetColors(int color) {
  ChannelMode = 4;

  for(int i=0; i<12; i++)
    Payload[i] = (int)(colors_tab[color][i] * brightness / 100);
}
//---------------------------------------------------------------------------

boolean PacketReceived() {
  Recv = Serial.read();

  switch (State) {
    case S_WAIT_FOR_SF:
      // =============================== Wait for start flag state
      switch (Recv) {
        case C_SF1:
          // Start flag for 1-channel mode
          ChannelMode = 1;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case C_SF2:
          // Start flag for 2-channel mode
          ChannelMode = 2;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case 243://C_SF3:
          // Start flag for 3-channel mode
          ChannelMode = 3;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case C_SF4:
          // Start flag for 4-channel mode
          ChannelMode = 4;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        default:
          // No action for all other characters
          return false;
      }
      break;
    case S_RECV_RGB:
      // =============================== RGB Data reception state
      switch (Recv) {
        case C_SF1:
          // Start flag for 1-channel mode
          ChannelMode = 1;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case C_SF2:
          // Start flag for 2-channel mode
          ChannelMode = 2;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case C_SF3:
          // Start flag for 3-channel mode
          ChannelMode = 3;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case C_SF4:
          // Start flag for 4-channel mode
          ChannelMode = 4;
          State = S_RECV_RGB;
          ByteCount = 0;
          return false;
        case C_END:
          // End Flag
          // For each channel, we should have received 3 values. If so, we have received a valid packet
          if (ByteCount == ChannelMode * 3) {
            State = S_WAIT_FOR_SF;
            ByteCount = 0;
            return true; // <------------------------ TRUE IS RETURNED
          }
          else {
            // Something's gone wrong: restart
            State = S_WAIT_FOR_SF;
            ByteCount = 0;
            return false;
          }
        case C_ESC:
          // Escape character
          State = S_RECV_RGB_ESC;
          return false;
        default:
          // The character received wasn't a flag, so store it as an RGB value        
          Payload[ByteCount] = Recv;
          ByteCount++;
          return false;
      }
      case S_RECV_RGB_ESC:
        // =============================== RGB Escaped data reception state
        // Store the value in the payload, no matter what it is
        Payload[ByteCount] = Recv;
        ByteCount++;
        State = S_RECV_RGB;
        return false;
  }

  return false;
}
//---------------------------------------------------------------------------

void SetPWMs() {
  // Channel 1
  r1_current = rgbStep(r1_current, Payload[0]);
  g1_current = rgbStep(g1_current, Payload[1]);
  b1_current = rgbStep(b1_current, Payload[2]);

  SoftPWMSet(r1_pin, r1_current);
  SoftPWMSet(g1_pin, g1_current);
  SoftPWMSet(b1_pin, b1_current);

  // Channel 2
  if (ChannelMode > 1) {
    r2_current = rgbStep(r2_current, Payload[3]);
    g2_current = rgbStep(g2_current, Payload[4]);
    b2_current = rgbStep(b2_current, Payload[5]);

    SoftPWMSet(r2_pin, r2_current);
    SoftPWMSet(g2_pin, g2_current);
    SoftPWMSet(b2_pin, b2_current);

  }
  else {
    // turn the rest to 0 (black)
    SoftPWMSet(r2_pin, 0);
    SoftPWMSet(g2_pin, 0);
    SoftPWMSet(b2_pin, 0);

    SoftPWMSet(r3_pin, 0);
    SoftPWMSet(g3_pin, 0);
    SoftPWMSet(b3_pin, 0);

    SoftPWMSet(r4_pin, 0);
    SoftPWMSet(g4_pin, 0);
    SoftPWMSet(b4_pin, 0);
  }

  // Channel 3
  if (ChannelMode > 2) {
    r3_current = rgbStep(r3_current, Payload[6]);
    g3_current = rgbStep(g3_current, Payload[7]);
    b3_current = rgbStep(b3_current, Payload[8]);

    SoftPWMSet(r3_pin, r3_current);
    SoftPWMSet(g3_pin, g3_current);
    SoftPWMSet(b3_pin, b3_current);

  }
  else {
    // turn the rest to 0 (black)
    SoftPWMSet(r3_pin, 0);
    SoftPWMSet(g3_pin, 0);
    SoftPWMSet(b3_pin, 0);

    SoftPWMSet(r4_pin, 0);
    SoftPWMSet(g4_pin, 0);
    SoftPWMSet(b4_pin, 0);
  }

   // Channel 4
  if (ChannelMode > 3) {
    r4_current = rgbStep(r4_current, Payload[9]);
    g4_current = rgbStep(g4_current, Payload[10]);
    b4_current = rgbStep(b4_current, Payload[11]);

    SoftPWMSet(r4_pin, r4_current);
    SoftPWMSet(g4_pin, g4_current);
    SoftPWMSet(b4_pin, b4_current);

  }
  else {
    // turn the rest to 0 (black)    
    SoftPWMSet(r4_pin, 0);
    SoftPWMSet(g4_pin, 0);
    SoftPWMSet(b4_pin, 0);
  }
}
//---------------------------------------------------------------------------

// rgbStep - the function for easing the colour changes
int rgbStep(int from, int to){
  if(to > from){          // destination colour is greater than current colour
    from += easing;
    if(from > 255){
     from = 255; 
    }
    return from;
  }
  else if(to < from){      // current colour is greater than destination colour
    from -= easing;
    if(from < 0){
      from = 0;
    }
    return from;
  }
  else{                    // values are the same...return as submitted
    return from;
  } 
}
Arturr300
Starszy majsterkowicz
Posty: 307
Rejestracja: 16 paź 2013, 17:24

Re: W sprawie Ambient light

Post autor: Arturr300 » 1 mar 2017, 09:16

Wygląda na to że ta biblioteka UnoLight wymaga jakiejś dodatkowej biblioteki do działania.
Na jakiej wersji arduino IDE kompilujesz program?
jancenty
Młodszy majsterkowicz
Posty: 9
Rejestracja: 11 lut 2017, 18:11

Re: W sprawie Ambient light

Post autor: jancenty » 1 mar 2017, 10:46

Wersja 1.0.5-r2
Arturr300
Starszy majsterkowicz
Posty: 307
Rejestracja: 16 paź 2013, 17:24

Re: W sprawie Ambient light

Post autor: Arturr300 » 1 mar 2017, 21:50

Spróbuj może na najnowszej (1.8.1), może biblioteka wykorzystuje jakieś pliki które są niedostępne w starszych wersjach.
jancenty
Młodszy majsterkowicz
Posty: 9
Rejestracja: 11 lut 2017, 18:11

Re: W sprawie Ambient light

Post autor: jancenty » 2 mar 2017, 12:18

Ten sam kod, najnowsza wersja Arduino i błąd:

Kod: Zaznacz cały

Arduino:1.8.1 (Windows 7), Płytka:"Arduino/Genuino Uno"

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:1:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/arduinoPins2Ports.h:49:0: warning: "PIN_A5" redefined

 #define PIN_A5  (PORTC, _BV(5))  // NOT USED BY LED

 ^

In file included from C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\cores\arduino/Arduino.h:257:0,

                 from sketch\sketch_mar02a.ino.cpp:1:

C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\variants\standard/pins_arduino.h:61:0: note: this is the location of the previous definition

 #define PIN_A5   (19)

 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:1:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/arduinoPins2Ports.h:50:0: warning: "PIN_A4" redefined

 #define PIN_A4  (PORTC, _BV(4))  // NOT USED BY LED

 ^

In file included from C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\cores\arduino/Arduino.h:257:0,

                 from sketch\sketch_mar02a.ino.cpp:1:

C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\variants\standard/pins_arduino.h:60:0: note: this is the location of the previous definition

 #define PIN_A4   (18)

 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:1:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/arduinoPins2Ports.h:51:0: warning: "PIN_A3" redefined

 #define PIN_A3  (PORTC, _BV(3))  // NOT USED BY LED

 ^

In file included from C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\cores\arduino/Arduino.h:257:0,

                 from sketch\sketch_mar02a.ino.cpp:1:

C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\variants\standard/pins_arduino.h:59:0: note: this is the location of the previous definition

 #define PIN_A3   (17)

 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:1:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/arduinoPins2Ports.h:53:0: warning: "PIN_A2" redefined

 #define PIN_A2  (PORTC, _BV(2))  

 ^

In file included from C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\cores\arduino/Arduino.h:257:0,

                 from sketch\sketch_mar02a.ino.cpp:1:

C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\variants\standard/pins_arduino.h:58:0: note: this is the location of the previous definition

 #define PIN_A2   (16)

 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:1:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/arduinoPins2Ports.h:54:0: warning: "PIN_A1" redefined

 #define PIN_A1  (PORTC, _BV(1))  

 ^

In file included from C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\cores\arduino/Arduino.h:257:0,

                 from sketch\sketch_mar02a.ino.cpp:1:

C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\variants\standard/pins_arduino.h:57:0: note: this is the location of the previous definition

 #define PIN_A1   (15)

 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:1:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/arduinoPins2Ports.h:55:0: warning: "PIN_A0" redefined

 #define PIN_A0  (PORTC, _BV(0))  

 ^

In file included from C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\cores\arduino/Arduino.h:257:0,

                 from sketch\sketch_mar02a.ino.cpp:1:

C:\Users\User\Desktop\arduino-1.8.1-windows\arduino-1.8.1\hardware\arduino\avr\variants\standard/pins_arduino.h:56:0: note: this is the location of the previous definition

 #define PIN_A0   (14)

 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:6:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:7:51: error: cannot convert 'byte* {aka unsigned char*}' to 'boolean* const {aka bool* const}' in initialization

 static boolean * const useGammaTable = &settings[0];       // If true then gamaTable from gamaTable.h is used to get leds brightnes level

                                                   ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:14:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:72:43: error: redefinition of 'word ledChannels [5][3]'

 static word ledChannels[NUM_OF_RGB_LEDS][3];

                                           ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:3:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:72:13: note: 'word ledChannels [5][3]' previously declared here

 static word ledChannels[NUM_OF_RGB_LEDS][3];

             ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:14:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:73:46: error: redefinition of 'word ledChannelsNew [5][3]'

 static word ledChannelsNew[NUM_OF_RGB_LEDS][3];

                                              ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:3:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:73:13: note: 'word ledChannelsNew [5][3]' previously declared here

 static word ledChannelsNew[NUM_OF_RGB_LEDS][3];

             ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:14:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:74:16: error: redefinition of 'boolean ledsOff'

 static boolean ledsOff = true;                  // flag indicating if LEDs are OFF or ON

                ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:3:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/leds.h:74:16: note: 'boolean ledsOff' previously defined here

 static boolean ledsOff = true;                  // flag indicating if LEDs are OFF or ON

                ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:16:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/gammaTable.h:14:33: error: redefinition of 'const word gammaTable [256]'

 static const word gammaTable[256] = {

                                 ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:2:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/gammaTable.h:14:19: note: 'const word gammaTable [256]' previously defined here

 static const word gammaTable[256] = {

                   ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:17:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:6:47: error: redefinition of 'const byte channelOrder [5]'

 static const byte channelOrder[NUM_OF_RGB_LEDS] = {1, 2, 3, 4, 0};

                                               ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:5:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:6:19: note: 'const byte channelOrder [5]' previously defined here

 static const byte channelOrder[NUM_OF_RGB_LEDS] = {1, 2, 3, 4, 0};

                   ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:17:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:16:28: error: redefinition of 'byte incomingData [16]'

 static byte incomingData[16]; // buffer array for incomming data over serial

                            ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:5:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:16:13: note: 'byte incomingData [16]' previously declared here

 static byte incomingData[16]; // buffer array for incomming data over serial

             ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:17:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:17:22: error: redefinition of 'long unsigned int timeOfLastTransmition'

 static unsigned long timeOfLastTransmition = millis();

                      ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:5:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/serialCommunication.h:17:22: note: 'long unsigned int timeOfLastTransmition' previously declared here

 static unsigned long timeOfLastTransmition = millis();

                      ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:18:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:5:40: error: redefinition of 'byte settings [15]'

 static byte settings[NUMBER_OF_SETTINGS]; // settings values

                                        ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:6:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:5:13: note: 'byte settings [15]' previously declared here

 static byte settings[NUMBER_OF_SETTINGS]; // settings values

             ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:18:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:7:24: error: redefinition of 'boolean* const useGammaTable'

 static boolean * const useGammaTable = &settings[0];       // If true then gamaTable from gamaTable.h is used to get leds brightnes level

                        ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:6:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:7:24: note: 'boolean* const useGammaTable' previously defined here

 static boolean * const useGammaTable = &settings[0];       // If true then gamaTable from gamaTable.h is used to get leds brightnes level

                        ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:18:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:8:21: error: redefinition of 'byte* const idleTimeLimit'

 static byte * const idleTimeLimit = &settings[3];          // Time (in seconds) without data transmision after which LEDs will turn off minus one second

                     ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:6:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:8:21: note: 'byte* const idleTimeLimit' previously defined here

 static byte * const idleTimeLimit = &settings[3];          // Time (in seconds) without data transmision after which LEDs will turn off minus one second

                     ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:18:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:9:21: error: redefinition of 'byte* const isSmoothEnabled'

 static byte * const isSmoothEnabled = &settings[4];        // If true smoothing of color changes is enabled (usefull when new values are supplied than 16 times per second)

                     ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:6:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:9:21: note: 'byte* const isSmoothEnabled' previously defined here

 static byte * const isSmoothEnabled = &settings[4];        // If true smoothing of color changes is enabled (usefull when new values are supplied than 16 times per second)

                     ^

In file included from C:\Users\User\Documents\Arduino\libraries\UnoLight/UnoLight.h:18:0,

                 from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:7:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:10:21: error: redefinition of 'byte* const smoothAmount'

 static byte * const smoothAmount = &settings[5];

                     ^

In file included from C:\Users\User\Desktop\sketch_mar02a\sketch_mar02a.ino:6:0:

C:\Users\User\Documents\Arduino\libraries\UnoLight/settings.h:10:21: note: 'byte* const smoothAmount' previously defined here

 static byte * const smoothAmount = &settings[5];

                     ^

exit status 1
Błąd kompilacji dla płytki Arduino/Genuino Uno.

Ten raport powinien zawierać więcej informacji jeśli w 
File -> Preferencje zostanie włączona opcja "Pokaż
szczegółowe informacje podczas kompilacji"
Chyba się poddam, zostawię to miganie. Już zamówiłem diody adresowane więc za niedługo kolejny projekt :)

Dzięki za pomoc :)
ODPOWIEDZ

Strony partnerskie: