Pages: [1]   Go Down
Author Topic: invalid suffix "D" on integer constant  (Read 1311 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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();
}
}
}
}
}



Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

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

Code:
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.
Logged

Pages: [1]   Go Up
Jump to: