-
Notifications
You must be signed in to change notification settings - Fork 46
/
print_HSV_values.ino
51 lines (39 loc) · 1.42 KB
/
print_HSV_values.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//***************************************************************
// Print out HSV values to serial monitor example...
//
// Marc Miller, July 2017
//***************************************************************
#include "FastLED.h"
#define DATA_PIN 11
#define CLOCK_PIN 13
#define LED_TYPE LPD8806
#define COLOR_ORDER GBR
#define NUM_LEDS 32
#define BRIGHTNESS 50
CRGB leds[NUM_LEDS];
CHSV hsv[NUM_LEDS];
//---------------------------------------------------------------
void setup() {
Serial.begin(115200); // Allows serial monitor output (check baud rate)
delay(1500); // startup delay for recovery
//FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.addLeds<LED_TYPE,DATA_PIN,CLOCK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(BRIGHTNESS);
FastLED.clear();
}
//---------------------------------------------------------------
void loop() {
EVERY_N_SECONDS( 5 ) {
for (uint8_t i=0; i < NUM_LEDS; i++) {
hsv[i].h = random8();
hsv[i].s = random8(200,256);
hsv[i].v = random8(64,85);
leds[i] = CHSV(hsv[i].h, hsv[i].s, hsv[i].v);
Serial.print("HSV["); Serial.print(i);
Serial.print("]: "); Serial.print(hsv[i].h);
Serial.print(" "); Serial.print(hsv[i].s);
Serial.print(" "); Serial.println(hsv[i].v);
}
FastLED.show();
}//end_EVERY_N
}//end_main_loop