-
Notifications
You must be signed in to change notification settings - Fork 0
/
mqtt_ledstrip.h
73 lines (60 loc) · 1.25 KB
/
mqtt_ledstrip.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef MQTT_LEDSTRIP_MQTT_LEDSTRIP_H
#define MQTT_LEDSTRIP_MQTT_LEDSTRIP_H
#include "config.h"
#include <SPI.h>
#include <FastLED.h>
#include "light.h"
#include "touchcontrol.h"
#ifdef IS_MEGA
#define DATA_PIN 42
#define CLOCK_PIN 43
#define USE_ETHERNET
#endif
#ifdef IS_ESP32
#define DATA_PIN 21
#define CLOCK_PIN 22
#define USE_WIFI
#endif
#ifndef NO_NETWORK
#include <Dns.h>
#include <Dhcp.h>
#include <PubSubClient.h>
#include <ArduinoJson.h>
#endif
#ifdef ARTNET
#include <Artnet.h>
#endif
#ifdef USE_WIFI
#include <WiFi.h>
#endif
#ifdef USE_ETHERNET
#include <Ethernet.h>
#endif
#ifndef DEVICE_NAME
#define DEVICE_NAME "led-bridge"
#endif
#ifdef TOUCH
#define TOUCH_PIN T0
#ifndef TOUCH_THRESHOLD
#define TOUCH_THRESHOLD 50
#endif
#endif
#ifndef NUM_LEDS
#define NUM_LEDS 25
#endif
#ifndef NUM_LIGHTS
#define NUM_LIGHTS 1
#endif
#ifndef NUM_PARAMS
#define NUM_PARAMS 3
#endif
#ifndef BRIGHTNESS_SCALE
#define BRIGHTNESS_SCALE 50
#endif
#define halt(s) { Serial.println(F( s )); while(1); }
void reconnect();
void blink();
void blink_rainbow();
void blackout();
void mqtt_callback(char* topic, byte* payload, unsigned int length);
#endif //MQTT_LEDSTRIP_MQTT_LEDSTRIP_H