Guest User

Untitled

a guest
Nov 19th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.25 KB | None | 0 0
  1. #include <FastLED.h> //rabos com todos eles em 1 degradê só
  2. #define REDPIN   11
  3. #define GREENPIN 10
  4. #define BLUEPIN 9
  5. #define REDPIN2   3
  6. #define GREENPIN2 5
  7. #define BLUEPIN2 6
  8. int t=1000; //variável do tempo para testar cada uma das cores da fita
  9.  
  10. void showAnalogRGB( const CRGB& rgb)
  11. {
  12.   analogWrite(REDPIN,   rgb.r );
  13.   analogWrite(GREENPIN, rgb.g );
  14.   analogWrite(BLUEPIN,  rgb.b );
  15.  
  16. /* - Por enquanto fiz assim, mas queria separar isso =x
  17.   analogWrite(REDPIN2,   rgb.r );
  18.   analogWrite(GREENPIN2, rgb.g );
  19.   analogWrite(BLUEPIN2,  rgb.b );
  20. */
  21. }
  22.  
  23. void loop()
  24. {
  25.  
  26. //rabos arcade - o loop dura 10s, 39ms cada cor
  27.  for (int cor = 0 ; cor <= 255; cor += 1)
  28.  {
  29.   showAnalogRGB( CHSV( cor, 255, 255) );
  30.     delay(39);
  31.  }
  32.  
  33. /*
  34.  //teste das cores
  35.   analogWrite(BLUEPIN, 0);    analogWrite(REDPIN, 255);    
  36.   analogWrite(BLUEPIN2, 0);    analogWrite(REDPIN2, 255);     delay(t);
  37.  
  38.   analogWrite(REDPIN, 0);     analogWrite(GREENPIN, 255);  
  39.   analogWrite(REDPIN2, 0);     analogWrite(GREENPIN2, 255);   delay(t);
  40.  
  41.   analogWrite(GREENPIN, 0);   analogWrite(BLUEPIN, 255);
  42.   analogWrite(GREENPIN2, 0);   analogWrite(BLUEPIN2, 255);
  43.  
  44.   delay(t);  delay(t);  delay(t);  delay(t);
  45. */
  46.  
  47. }
  48.  
  49. void setup()
  50. {
  51.   FastLED.setBrightness(180);
  52. }
Advertisement
Add Comment
Please, Sign In to add comment