Skip to content

Commit b0552fb

Browse files
committed
Project organized based on arduino library specification;
1 parent a9284d1 commit b0552fb

4 files changed

Lines changed: 77 additions & 0 deletions

File tree

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* StreamlabsArduinoAlerts.ino
3+
*
4+
* Created on: 02/10/2020
5+
* Author: Luca Taddeo
6+
*
7+
*/
8+
9+
#include <Arduino.h>
10+
#include <Esp.h>
11+
#include <ESP8266WiFi.h>
12+
#include <StreamlabsAPI.h>
13+
14+
#define SSID "ssid"
15+
#define PASSWORD "password"
16+
#define SOCKET_TOKEN "token"
17+
18+
StreamlabsAPI streamlabsAPI;
19+
20+
void followerEvent(const char * payload) {
21+
Serial.print("got followerEvent message: ");
22+
Serial.println(payload);
23+
}
24+
25+
void subscriptionEvent(const char * payload) {
26+
Serial.print("got subscriptionEvent message: ");
27+
Serial.println(payload);
28+
}
29+
30+
void bitsEvent(const char * payload) {
31+
Serial.print("got bitsEvent message: ");
32+
Serial.println(payload);
33+
}
34+
35+
void donationsEvent(const char * payload) {
36+
Serial.print("got donationsEvent message: ");
37+
Serial.println(payload);
38+
}
39+
40+
void setup() {
41+
42+
Serial.begin(115200);
43+
delay(1000);
44+
45+
46+
WiFi.begin(SSID, PASSWORD);
47+
int i = 0;
48+
while (WiFi.status() != WL_CONNECTED) {
49+
delay(1000);
50+
Serial.print(++i); Serial.print(' ');
51+
}
52+
53+
Serial.println('\n');
54+
Serial.println("Connection established!");
55+
Serial.print("IP address:\t");
56+
Serial.println(WiFi.localIP());
57+
58+
streamlabsAPI.followTwitchEvent(followerEvent);
59+
streamlabsAPI.subscriptionsTwitchEvent(subscriptionEvent);
60+
streamlabsAPI.bitsTwitchEvent(bitsEvent);
61+
streamlabsAPI.donationEvent(donationsEvent);
62+
streamlabsAPI.connect(SOCKET_TOKEN);
63+
}
64+
65+
void loop() {
66+
streamlabsAPI.loop();
67+
}

library.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=StreamlabsArduinoAlerts
2+
version=0.1
3+
author=Luca Taddeo
4+
maintainer=Luca Taddeo
5+
sentence=Library to get Streamlabs event from Twitch
6+
paragraph=A work in progress library to connect to your Streamlabs account and catch all the Twitch events.
7+
category=Communication
8+
url=https://github.com/lucalas/StreamlabsArduinoAlerts
9+
architectures=*
10+
depends=SocketIoClient
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)