diff --git a/examples/Ethernet/receiver/receiver.ino b/examples/Ethernet/receiver/receiver.ino index 5f0e7e7..dbbc2c7 100644 --- a/examples/Ethernet/receiver/receiver.ino +++ b/examples/Ethernet/receiver/receiver.ino @@ -1,7 +1,7 @@ #include // Ethernet stuff -const IPAddress ip(192, 168, 1, 201); +const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; ArtnetReceiver artnet; @@ -24,8 +24,10 @@ void setup() artnet.subscribe(universe1, [&](uint8_t* data, uint16_t size) { Serial.print("artnet data (universe : "); - Serial.print(universe1); - Serial.println(") = "); + Serial.print(universe); + Serial.print(", size = "); + Serial.print(size); + Serial.print(") :"); for (size_t i = 0; i < size; ++i) { Serial.print(data[i]); Serial.print(","); diff --git a/examples/Ethernet/send_receive/send_receive.ino b/examples/Ethernet/send_receive/send_receive.ino index 48e68b2..3a18355 100644 --- a/examples/Ethernet/send_receive/send_receive.ino +++ b/examples/Ethernet/send_receive/send_receive.ino @@ -1,22 +1,24 @@ #include // Ethernet stuff -const IPAddress ip(192, 168, 1, 201); +const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; Artnet artnet; +const String target_ip = "192.168.0.200"; +uint32_t universe = 1; const uint16_t size = 512; uint8_t data[size]; uint8_t value = 0; -uint32_t universe = 1; void setup() { Serial.begin(115200); + delay(2000); Ethernet.begin(mac, ip); - artnet.begin("127.0.0.1"); // send to localhost + artnet.begin(target_ip); Serial.println("set subscriber"); @@ -25,7 +27,9 @@ void setup() { Serial.print("artnet data (universe : "); Serial.print(universe); - Serial.println(") = "); + Serial.print(", size = "); + Serial.print(size); + Serial.print(") :"); for (size_t i = 0; i < size; ++i) { Serial.print(data[i]); Serial.print(","); @@ -48,11 +52,9 @@ void loop() { artnet.parse(); // check if artnet packet has come and execute callback - value = millis() % 256; + value = (millis() / 4) % 256; memset(data, value, size); artnet.set(universe, data, size); artnet.streaming(); // automatically send set data in 40fps - - // Serial.println("loop"); } diff --git a/examples/Ethernet/sender/sender.ino b/examples/Ethernet/sender/sender.ino index c3ed9f0..e64df2d 100644 --- a/examples/Ethernet/sender/sender.ino +++ b/examples/Ethernet/sender/sender.ino @@ -1,10 +1,11 @@ #include // Ethernet stuff -const IPAddress ip(192, 168, 1, 201); +const IPAddress ip(192, 168, 0, 201); uint8_t mac[] = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB}; ArtnetSender artnet; +const String target_ip = "192.168.0.200"; uint32_t universe = 1; const uint16_t size = 512; @@ -13,15 +14,24 @@ uint8_t value = 0; void setup() { + Serial.begin(115200); + delay(2000); + Ethernet.begin(mac, ip); - artnet.begin("127.0.0.1"); + artnet.begin(target_ip); + + + Serial.println("start"); + Serial.println(UDP_TX_PACKET_MAX_SIZE); } void loop() { - value = millis() % 256; + value = (millis() / 4) % 256; memset(data, value, size); artnet.set(universe, data, size); artnet.streaming(); // automatically send set data in 40fps + + // Serial.println("loop"); } diff --git a/examples/WiFi/receiver/receiver.ino b/examples/WiFi/receiver/receiver.ino index 4830cc8..c4d039c 100644 --- a/examples/WiFi/receiver/receiver.ino +++ b/examples/WiFi/receiver/receiver.ino @@ -32,8 +32,10 @@ void setup() artnet.subscribe(universe1, [&](uint8_t* data, uint16_t size) { Serial.print("lambda : artnet data (universe : "); - Serial.print(universe1); - Serial.println(") = "); + Serial.print(universe); + Serial.print(", size = "); + Serial.print(size); + Serial.print(") :"); for (size_t i = 0; i < size; ++i) { Serial.print(data[i]); Serial.print(","); diff --git a/examples/WiFi/send_receive/send_receive.ino b/examples/WiFi/send_receive/send_receive.ino index 2fee298..e51e258 100644 --- a/examples/WiFi/send_receive/send_receive.ino +++ b/examples/WiFi/send_receive/send_receive.ino @@ -8,11 +8,12 @@ const IPAddress gateway(192, 168, 1, 1); const IPAddress subnet(255, 255, 255, 0); ArtnetWiFi artnet; +const String target_ip = "192.168.1.200"; +uint32_t universe = 1; const uint16_t size = 512; uint8_t data[size]; uint8_t value = 0; -uint32_t universe = 1; void setup() { @@ -24,14 +25,16 @@ void setup() while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.print("WiFi connected, IP = "); Serial.println(WiFi.localIP()); - artnet.begin("127.0.0.1"); // send to localhost + artnet.begin(target_ip); // if Artnet packet comes to this universe, this function is called artnet.subscribe(universe, [&](uint8_t* data, uint16_t size) { Serial.print("artnet data (universe : "); Serial.print(universe); - Serial.println(") = "); + Serial.print(", size = "); + Serial.print(size); + Serial.print(") :"); for (size_t i = 0; i < size; ++i) { Serial.print(data[i]); Serial.print(","); @@ -51,7 +54,7 @@ void loop() { artnet.parse(); // check if artnet packet has come and execute callback - value = millis() % 256; + value = (millis() / 4) % 256; memset(data, value, size); artnet.set(universe, data, size); diff --git a/examples/WiFi/sender/sender.ino b/examples/WiFi/sender/sender.ino index 171ba00..32d9d40 100644 --- a/examples/WiFi/sender/sender.ino +++ b/examples/WiFi/sender/sender.ino @@ -8,6 +8,7 @@ const IPAddress gateway(192, 168, 1, 1); const IPAddress subnet(255, 255, 255, 0); ArtnetWiFiSender artnet; +const String target_ip = "192.168.1.200"; uint32_t universe = 1; const uint16_t size = 512; @@ -24,12 +25,12 @@ void setup() while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.print("WiFi connected, IP = "); Serial.println(WiFi.localIP()); - artnet.begin("127.0.0.1"); + artnet.begin(target_ip); } void loop() { - value = millis() % 256; + value = (millis() / 4) % 256; memset(data, value, size); artnet.set(universe, data, size);