33
33
#include < ArduinoJson.h>
34
34
#include < FastLED.h>
35
35
36
+ #include " secret.h"
37
+
36
38
// Initialize network parameters
37
- const char * ssid = " YOUR_SSID " ;
38
- const char * password = " YOUR_PASSWORD " ;
39
+ const char ssid[] = SECRET_SSID;
40
+ const char password[] = SECRET_PASS ;
39
41
40
42
// Declare websocket client class variable
41
43
WebSocketsClient webSocket;
@@ -44,14 +46,14 @@ WebSocketsClient webSocket;
44
46
StaticJsonDocument<200 > doc;
45
47
46
48
// Parameters for Twitch channel
47
- # define TWITCH_OAUTH_TOKEN " YOUR_OAUTH_TOKEN " // per Twitch's API
48
- // developer guide: https://twitchapps.com/tmi
49
- # define TWITCH_NICK " YOUR_CHANNELS_NAME " // e.g., acrobotik
50
- # define TWITCH_CHANNEL " #YOUR_CHANNELS_NAME " // e.g., #acrobotik
49
+ const char twitch_oauth_token[] = TWITCH_OAUTH_TOKEN;
50
+
51
+ const char twitch_nick[] = TWITCH_NICK;
52
+ const char twitch_channel[] = TWITCH_CHANNEL;
51
53
52
54
// Define necessary parameters for controlling the WS2812B LEDs
53
55
#define N_PIXELS 16
54
- #define LED_PIN 19 // labeled "D6" on the board
56
+ #define LED_PIN 0 // labeled "D6" on the board
55
57
#define LED_TYPE WS2811
56
58
#define BRIGHTNESS 24 // a little dim for recording purposes
57
59
#define COLOR_ORDER GRB
@@ -90,9 +92,9 @@ void webSocketEvent(WStype_t type, uint8_t * payload, size_t length) {
90
92
// If the websocket connection is succesful, try to join the IRC server
91
93
case WStype_CONNECTED:
92
94
Serial.printf (" [WSc] Connected to: %s\n " , payload);
93
- webSocket.sendTXT (" PASS " + String (TWITCH_OAUTH_TOKEN ) + " \r\n " );
94
- webSocket.sendTXT (" NICK " + String (TWITCH_NICK ) + " \r\n " );
95
- webSocket.sendTXT (" JOIN " + String (TWITCH_CHANNEL ) + " \r\n " );
95
+ webSocket.sendTXT (" PASS " + String (twitch_oauth_token ) + " \r\n " );
96
+ webSocket.sendTXT (" NICK " + String (twitch_nick ) + " \r\n " );
97
+ webSocket.sendTXT (" JOIN " + String (twitch_channel ) + " \r\n " );
96
98
break ;
97
99
// If we get a response, print it to Serial
98
100
case WStype_TEXT: {
@@ -147,4 +149,4 @@ void setRgb(uint8_t i, uint8_t r, uint8_t g, uint8_t b) {
147
149
148
150
void loop () {
149
151
webSocket.loop ();
150
- }
152
+ }
0 commit comments