Decimal points error

Hello guys

I have the next error on the code you can see below.

Test_Chamsys_Ethernet.cpp:23:54: error: too many decimal points in number

#include <SPI.h>        
#include <Ethernet.h>
#include <EthernetUdp.h>

// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = {  
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(192, 168, 1, 1);

unsigned int localPort = 8080;      // local port to listen on

// An EthernetUDP instance to let us send and receive packets over UDP
EthernetUDP Udp;

void setup()
{
  
  Ethernet.begin(0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED, 192.168.1.1);                        //Start the Ethernet and UDP
  Udp.begin(8080);
  
  pinMode(22, INPUT);                            // Sets the digital pin as input
  pinMode(23, INPUT);                            // Sets the digital pin as input
  pinMode(24, INPUT);                            // Sets the digital pin as input
  pinMode(25, INPUT);                            // Sets the digital pin as input
}

void loop()
{
   if (digitalRead(22) && digitalRead(23))
        sendPacket("g1");

   if (digitalRead(24) && digitalRead(25))
        sendPacket("g2");
}

void sendPacket(char *contents)
{
    Udp.beginPacket(Udp.remoteIP(), Udp.remotePort());
    Udp.write(contents);
    Udp.endPacket();
}

What's the real problem in this case
And is there anyone who can help me?

Thanks

Leon

  Ethernet.begin(0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED, 192.168.1.1);                        //Start the Ethernet and UDP
                                                     -----------
                                                      This here

Look at the example code:

#include <Ethernet.h>

// the media access control (ethernet hardware) address for the shield:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  
//the IP address for the shield:
byte ip[] = { 10, 0, 0, 177 };    

void setup()
{
  Ethernet.begin(mac, ip);
}

void loop () {}

You can't pass the mac and ip addresses as literals.

Thanks for the fast reply.

I have one more question
Is the complete code ok?
Or are there things wrong.

Thanks

Leon