Need help to use RGB chainable leds + Light Sensor

I'm an extreme beginner. I have to light up chainable rgb leds with the possibility to change the color whenever I want with an android application. I also need to program a light sensor to change the luminosity when it get darker/brighter.

As I said I'm a beginner, so I can't really do things by myself. I tried to use a ChainableRGB example and take parts of a program I found on internet to change luminosity with a light sensor but I just get errors I don't understand and I don't find any help on internet.

I decided to start from zero and ask help here to have a clear path. Hope you can help me thanks

If you post the code that you tried and the errors, we can help to get it working. Please read the "How to use the from-please read" stickies to see how to properly format and post code and error messages. See #7 & #11 especially.

int sensorPin = A0;

int sensorValue = 0;

#include <ChainableLED.h>

#define NUM_LEDS  5

ChainableLED leds(7, 8, NUM_LEDS);

void setup(){

float hue = 0.0;
boolean up = true;

void loop(){
sensorValue = analogRead(sensorPin);


  for (byte i=0; i<NUM_LEDS; i++)
    leds.setColorHSB(i, hue, 1.0, 0.5);
  if (up)
    hue+= 0.025;
    hue-= 0.025;
  if (hue>=1.0 && up)
    up = false;
  else if (hue<=0.0 && !up)
    up = true;
    analogWrite(leds, sensorValue/1.5); 
CycleThroughColors.ino: In function 'void loop()':
CycleThroughColors.ino:40:38: error: cannot convert 'ChainableLED' to 'uint8_t {aka unsigned char}' for argument '1' to 'void analogWrite(uint8_t, int)'

This is the best code I can do (By “the best” I mean the one with less errors…).

I’m using an Arduino Uno with Arduino 1.6.2.

I found posts about that error on internet but I really don’t understand anything.

the error message is telling you that one of the parameters that you have given the analogWrite function will not work with the function. AnalogWrite expects a pin number and a byte (PWM output). You try to feed it an object (leds) instead of a pin number.

AnalogWrite will not work with that library. There are only 2 functions to control the LEDs.

 void setColorRGB(byte led, byte red, byte green, byte blue);
 void setColorHSB(byte led, float hue, float saturation, float brightness);

setColorRGB gets a byte to address the LED you want to set. Your 5 LEDs are probably numbered 0-4.
Then a byte that sets the brightness of each color.

And thank you for reading the stickies and following the guidelines.
setColorHSB gets the byte address and the HSB parameters. Google “HSB colors” to see what that means.
The last parameter is the brightness. Use the analogRead value to set the brightness. The map() function will help to convert the 0-1023 from the analogRead to the 0-255 for the brightness byte.

Thanks for following the guideline for posting.