You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,24 @@ Include the library in your sketch and initialize it with your WiFi credentials.
20
20
21
21
## Methods
22
22
23
-
-`begin(const char* ssid, const char* password)`: Initialize the library with your WiFi credentials.
23
+
-`begin(const char* ssid, const char* password)`: Initialize the library with your WiFi credentials to let the library handle the WiFi connection.
24
+
-`begin()`: Initialize the library without WiFi credentials (use this if you want to manually connect to the WiFi network and manage the WiFi connection outside of the library).
25
+
-`reconnect()`: Reconnect to the WiFi network.
26
+
-`isConnected()`: Returns a boolean indicating whether the library is connected to the WiFi network.
24
27
-`getCurrentColor()`: Get the current CheerLights color from ThingSpeak channel 1417. Returns a pointer to a constant char array.
25
28
-`currentColorName()`: The current CheerLights color name (e.g. "red"). Returns a pointer to a constant char array.
26
29
-`currentColorHex()`: The current CheerLights color as a hex value (e.g. 0xFF0000). Returns a uint32_t.
27
-
-`currentRed()`, `currentGreen()`, `currentBlue()`: The RGB values for the current CheerLights color (e.g. 255, 0, 0). Returns a uint8_t.
30
+
-`currentRed()`, `currentGreen()`, `currentBlue()`: The RGB values for the current CheerLights color (e.g. 255, 0, 0). Returns a uint8_t.
31
+
-`hasColorChanged()`: Returns a boolean indicating whether the current CheerLights color has changed since the last call to this method.
32
+
33
+
## Compatibility
34
+
35
+
This library supports WiFi-enabled Arduino-compatible boards. It has been tested with the following boards:
Copy file name to clipboardExpand all lines: examples/CheerLights_NeoPixel_Strip/CheerLights_NeoPixel_Strip.ino
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
/*
2
-
'CheerLightsExample' demonstrates how to use the CheerLights Arduino library to fetch and display the current CheerLights color on an Adafruit NeoPixel LED strip.
2
+
'CheerLights_NeoPixel_Strip' example demonstrates how to use the CheerLights Arduino library to fetch and display the current CheerLights color on an Adafruit NeoPixel LED strip.
3
3
4
-
To learn more about CheerLights, visit https://cheerlights.com.
4
+
To join the CheerLights community, visit https://cheerlights.com.
5
5
*/
6
6
7
7
// Include the Adafruit NeoPixel library and initialize the strip
@@ -44,14 +44,20 @@ unsigned long previousMillis = 0;
44
44
constlong updateInterval = 15000;
45
45
46
46
voidsetup() {
47
-
Serial.begin(115200);
47
+
// Initialize serial communication
48
+
Serial.begin(115200);
49
+
50
+
// Initialize the CheerLights library
48
51
CheerLights.begin(SECRET_SSID, SECRET_PASSWORD);
52
+
53
+
// Initialize the NeoPixel strip
49
54
strip.begin();
50
55
51
56
// Get the current CheerLights color and set the LEDs to that color
0 commit comments