I am getting this error while compiling the code that uses the EtherCard Library:
invalid application of ‘sizeof’ to incomplete type ‘uint8_t {aka unsigned char }’
at line : if (ether.begin(sizeof Ethernet::buffer, mymac, 53) == 0)
however the same line in different code compiles fine.
#include <EtherCard.h>
#include "Dewpnt_heatIndx.h"
#include<dht.h>
dht DHT;
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
static byte mac[] = {
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
};
static byte myip[] = { 192, 168, 1, 177 };
// Initialize the Ethernet server library
// with the IP address and port you want to use
// (port 8900 is default for HTTP):
String rainMsg;
// ///////////// PIN Setup /////////////////
int solenoidPin = 6; // D6 : This is the output pin on the Arduino we are using
#define DHT11_PIN 8 // D8 to 2nd pin on DHT, leave 3rd pin unconnected 4th is gnd
int rainsense = 2; // analog sensor input pin A2
int buzzerout = 2; // digital output pin D2 - buzzer output
int countval = 0; // counter value starting from 0 and goes up by 1 every second
int GLED = 5; // Wet Indicator at Digital PIN D5
int RLED = 9; // Dry Indicator at Digital PIN D9
int SENSE = 1; // Soil Sensor input at Analog PIN A1
int val = 0;
int greenLedPin = 2; // LED on pin 2
int yellowLedPin = 3;
int redLedPin = 4;
int lightSensorPin = A0;
int analogValue = 0;
double tempInC;
int humidity;
float dP; // dew point
float dPF; // dew point in fahrenheit
float tF; // temperature in fahrenheit
double hIinFah;
double hIinCel;
void setup() {
// start the Ethernet connection and the server:
if (ether.begin(sizeof Ethernet::buffer, mymac, 53) == 0)
Serial.println( "Failed to access Ethernet controller");
ether.staticSetup(myip, 8900);
pinMode(solenoidPin, OUTPUT); // Sets the pin as an output
pinMode(buzzerout, OUTPUT);
pinMode(rainsense, INPUT);
pinMode(greenLedPin, OUTPUT); // LED on pin 2
pinMode(yellowLedPin, OUTPUT);
pinMode(redLedPin, OUTPUT);
pinMode(GLED, OUTPUT);
pinMode(RLED, OUTPUT);
}