-
Notifications
You must be signed in to change notification settings - Fork 0
Artnet::begin()
This function is alsway required. It is used to enable the ethernet library, and start the udp listining on the Art-Net port. Additionally, it loads all default values.
There are two different ways to use this function.
Uses DCHP to get an IP-addres assigned. mac[] is a 6 byte long array which stores the mac address of the ethernet module.
In case you want a fixed (static) IP.
1 = DCHP IP address was assigned successfully 0 = No DCHP address was assigned.
No return.
` #include <Artnet.h>
Artnet artnet; byte mac[] = {0x04, 0xE9, 0xE5, 0x00, 0x69, 0xEC}; vodi setup() { while(!artnet.begin(mac)) delay(5); //Retry untill an IP address is assigned. }
void loop() { uint16_t r = artnet.read(); if(r == ART_POLL) { // A poll message was received. (library answers the poll automatically) // it lets you know it did. } } `
` #include <Artnet.h>
Artnet artnet; byte ip[4] = {2, 0, 0, 15}; byte mac[6] = {0x04, 0xE9, 0xE5, 0x00, 0x69, 0xEC}; vodi setup() { artnet.begin(mac, ip); }
void loop() { uint16_t r = artnet.read(); if(r == ART_POLL) { // A poll message was received. (library answers the poll automatically) // it lets you know it did. } } `
Art-Net™ Designed by and Copyright Artistic Licence Holdings Ltd