Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h> //rabos com todos eles em 1 degradê só
- #define REDPIN 11
- #define GREENPIN 10
- #define BLUEPIN 9
- #define REDPIN2 3
- #define GREENPIN2 5
- #define BLUEPIN2 6
- int t=1000; //variável do tempo para testar cada uma das cores da fita
- void showAnalogRGB( const CRGB& rgb)
- {
- analogWrite(REDPIN, rgb.r );
- analogWrite(GREENPIN, rgb.g );
- analogWrite(BLUEPIN, rgb.b );
- /* - Por enquanto fiz assim, mas queria separar isso =x
- analogWrite(REDPIN2, rgb.r );
- analogWrite(GREENPIN2, rgb.g );
- analogWrite(BLUEPIN2, rgb.b );
- */
- }
- void loop()
- {
- //rabos arcade - o loop dura 10s, 39ms cada cor
- for (int cor = 0 ; cor <= 255; cor += 1)
- {
- showAnalogRGB( CHSV( cor, 255, 255) );
- delay(39);
- }
- /*
- //teste das cores
- analogWrite(BLUEPIN, 0); analogWrite(REDPIN, 255);
- analogWrite(BLUEPIN2, 0); analogWrite(REDPIN2, 255); delay(t);
- analogWrite(REDPIN, 0); analogWrite(GREENPIN, 255);
- analogWrite(REDPIN2, 0); analogWrite(GREENPIN2, 255); delay(t);
- analogWrite(GREENPIN, 0); analogWrite(BLUEPIN, 255);
- analogWrite(GREENPIN2, 0); analogWrite(BLUEPIN2, 255);
- delay(t); delay(t); delay(t); delay(t);
- */
- }
- void setup()
- {
- FastLED.setBrightness(180);
- }
Advertisement
Add Comment
Please, Sign In to add comment