|
- #include <FastLED.h>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- #define REDPIN 5
- #define GREENPIN 6
- #define BLUEPIN 3
-
-
-
-
-
-
-
- void showAnalogRGB( const CRGB& rgb)
- {
- analogWrite(REDPIN, rgb.r );
- analogWrite(GREENPIN, rgb.g );
- analogWrite(BLUEPIN, rgb.b );
- }
-
-
-
-
-
- void colorBars()
- {
- showAnalogRGB( CRGB::Red ); delay(500);
- showAnalogRGB( CRGB::Green ); delay(500);
- showAnalogRGB( CRGB::Blue ); delay(500);
- showAnalogRGB( CRGB::Black ); delay(500);
- }
-
- void loop()
- {
- static uint8_t hue;
- hue = hue + 1;
-
- showAnalogRGB( CHSV( hue, 255, 255) );
-
- delay(20);
- }
-
-
- void setup() {
- pinMode(REDPIN, OUTPUT);
- pinMode(GREENPIN, OUTPUT);
- pinMode(BLUEPIN, OUTPUT);
-
-
- colorBars();
- }
|