Go Down

Topic: invalid suffix "D" on integer constant (Read 1 time) previous topic - next topic

peter1929

Hello All , have this problem, sw compiles then at the end shows this error ?

Any Had this before ?

This was written for ver 0022 , just upgrade client to ethernet client same with server.

tried running this in ver 0022 still same "D" Problem ?

Help still learning.

Code: [Select]
Quote

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

byte mac[] = { 1A-2B-3C-4D-5E-6F };
byte ip[] = { 10 ,1 ,1 ,9 };
byte gateway[] = { 198 ,168 ,1 ,1 };
byte subnet[] = { 255 ,255 ,255 ,0 };
EthernetServer server(80);

String readString = String(30);
 

void setup(){
Ethernet.begin(mac, ip, gateway, subnet);
delay(1000);
pinMode(5, OUTPUT);
digitalWrite(5, LOW);
Serial.begin(9600);


void loop(){
EthernetClient client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (readString.length() < 30)
{
readString = readString + c;
}
if (c == '\n') {
Serial.print(readString);
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();


if(readString.startsWith("GET /?out=5&status=1"))
{Serial.print("\n 5 HIGH LOW \n");
digitalWrite(5, HIGH);
delay(100);
digitalWrite(5, LOW);
client.print("{\"status\" : \"1\" , \"out\" : \"");
client.print(5);
client.print("\"}");
}


if(readString.startsWith("GET /?out=all"))
{
Serial.print("\n OUT ALL\n");
client.print("{\"ip\" : \"10.1.1.9\", ");
client.print("\"devices\" : ");
client.print("[{ \"type\" : \"door\", \"name\" : \"OPENING ROOF\", \"out\" : \"");
client.print("5");
client.print("\"}");
client.print("]}");
}
readString="";
client.stop();
}
}
}
}
}




dxw00d

I would think it is something to to with this line...

Code: [Select]
byte mac[] = { 1A-2B-3C-4D-5E-6F };

The reference page for the ethernet begin() call shows this...

Code: [Select]
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  


peter1929


I would think it is something to to with this line...

Code: [Select]
byte mac[] = { 1A-2B-3C-4D-5E-6F };

The reference page for the ethernet begin() call shows this...

Code: [Select]
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  

   Thank you, as well al know the problem can be looking you right in the face sometimes. that you for your assistance.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy