Is there a difference between uint8_t and byte data types?
There is no difference in the datatype.
byte is defined in Arduino.h:
typedef uint8_t byte;
byte are exactly the same. The
uintX_t types and their siblings are specifically meant for having the same size on every platform (in difference to for example
double which is only 16 bits on Arduino Uno, but can be 32 bits on bigger chips). But
byte will also be 8 bits on every platform, so there is really no difference.
Am I getting the syntax wrong? I get an error - convertion from 'uint8_t' to non scalar type 'CHSV' requasted. I thought the library does that on its own, do I need to add more code? If yes, what code?
You get the error, because you use the wrong syntax here. A
CHSV color is not just 3 byte values, it is a class with member variables and methods. So you cannot simply assign 3 byte values directly to the object. You need to actually create the object, using the values as parameters for the constructor:
CHSV led = CHSV( hue, sat, val);
This creates a
CHSV object, executes it's constructor, which uses the values from the parameters to set the internal values. That is the context, how this is used in the FastLED library. You can also find such lines in the examples of the library (I found such use in line 15 of the example
ColorPalette, but there might be more). Also this is the same principle, as with the other color classes, like