#include <FastLED.h>
#include <NativeEthernet.h>
// Device Addresses
// MAC address of this device (Use MAC Address Generator app)
byte mac[] = {0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x4C};
// Unique IP address assigned to device
const IPAddress ip(192, 168, 0, 205);
// Gateway Address
const IPAddress gateway(192, 168, 0, 1);
//Subnet Mask
const IPAddress subnet(255, 255, 255, 0);
//DNS Server Address
const IPAddress dnServer(192, 168, 0, 1);
// IP address of the machine running the MQTT server
// Global Variables
// Create an instance of the Ethernet client
EthernetClient ethernetClient;
// Create an instance of the MQTT client based on the ethernet client
//PubSubClient MQTTclient(ethernetClient);
// The time (from millis()) at which last message was published
long lastMsgTime = 0;
// A buffer to hold messages to be sent/have been received
char msg[64];
// The topic in which to publish a message
char topic[32];
// Counter for number of heartbeat pulses sent
int pulseCount = 0;
#define LED_STRIP_PIN 19 // Data for side A LED strip
#define NUMBER_OF_STRIPS 1
#define CHIPSET WS2811
#define COLOR_ORDER GRB
#define LEDS_PER_STRIP 72
CRGB leds_test[LEDS_PER_STRIP];
void setup() {
Serial.begin(115200);
ethernetSetup(); //UDP_MAX_PACKET_SIZE 1500 - NativeEthernet.h
delay(1000);
FastLED.addLeds<NUMBER_OF_STRIPS, CHIPSET, LED_STRIP_PIN, COLOR_ORDER>(leds_test, LEDS_PER_STRIP);
}
void loop() {
fill_solid(leds_test,LEDS_PER_STRIP, CRGB::Green);
FastLED.show();
delay(1000);
fill_solid(leds_test,LEDS_PER_STRIP, CRGB::Black);
FastLED.show();
delay(1000);
interrupts();
}
void ethernetSetup() {
// start the Ethernet connection:
Serial.println("Initialize Ethernet:");
Ethernet.begin(mac, ip, dnServer, gateway, subnet);
delay(1500);
// print your local IP address:
Serial.print("My IP address: ");
Serial.println(Ethernet.localIP());
delay(1000);
}