You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
876 B
Arduino

6 years ago
#include <Artnet.h>
// WiFi stuff
const char* ssid = "your-ssid";
const char* pwd = "your-password";
const IPAddress ip(192, 168, 1, 201);
const IPAddress gateway(192, 168, 1, 1);
const IPAddress subnet(255, 255, 255, 0);
ArtnetWiFiSender artnet;
4 years ago
const String target_ip = "192.168.1.200";
6 years ago
uint32_t universe = 1;
const uint16_t size = 512;
uint8_t data[size];
uint8_t value = 0;
void setup()
{
Serial.begin(115200);
6 years ago
// WiFi stuff
WiFi.begin(ssid, pwd);
WiFi.config(ip, gateway, subnet);
while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); }
Serial.print("WiFi connected, IP = "); Serial.println(WiFi.localIP());
4 years ago
artnet.begin(target_ip);
6 years ago
}
void loop()
{
4 years ago
value = (millis() / 4) % 256;
6 years ago
memset(data, value, size);
artnet.set(universe, data, size);
artnet.streaming(); // automatically send set data in 40fps
}