null was not declared in this scope

Hi. I am basically trying to make a post request to a webservice. I am getting the error of “null was not declared in this scope” at the following line:“”, 80, url, null); (it is toward the end of the program)
The whole program is thus:
#include <SPI.h>
#include <Ethernet.h>
#include <HttpClient.h>
#include <String.h>

//change these
byte mac = { 0x90, 0xA2, 0xDA, 0x0D, 0xB2, 0xAE };
const char kPath = “/v2/feeds/54021.csv”;
const char kHostname = “”;

int readlight(int lt){

float tmpflt = (float)lt1.1/1024;
int percent = 100

if(percent > 100)
percent = 100;
if(percent < 0 )
percent = 0;

return percent;

int readtemp(int tm){

float tmpflt = (float)tm*1.1/1024;

int Rth = 0;
boolean done = false;

while(done == false){

float res1 = tmpflt*((float)Rth+1000);
float res2 = (float)Rth*3.3;

if(res2 > res1)
done = true;
else Rth+=1;

float tmptemp = 25.0+(float)(Rth-500)(-0.05);
float fahrenheight = 32+tmptemp

int tmpout = (int)fahrenheight;

return tmpout;


int readfromserial(){


if(Serial.available() > 0)

int readvalue(int sensorid, int mode){

const double ref = 1.1;

int length;
int address;
int signalstrength;
byte tmp;

double voltage0, voltage1;

boolean done = false;

while(done == false){
if( == 0x7E){

int lengthh = readfromserial();
int lengthl = readfromserial();
length = 256*lengthh+lengthl;

if(readfromserial() == 0x83){

int addressh = readfromserial();
int addressl = readfromserial();
address = 256*addressh+addressl;

if(address == (sensorid-1)){
done =true;

signalstrength = readfromserial();

for(int i = 1;i <= 6; i++){
tmp = readfromserial();

int ad0h = readfromserial();
int ad0l = readfromserial();
int ad0tmp = 256*ad0h+ad0l;

int ad1h = readfromserial();
int ad1l = readfromserial();
int ad1tmp = 256*ad1h+ad1l;

if(mode == 0)
return readlight(ad0tmp);

if(mode == 1)
return readtemp(ad1tmp);


return -1;

EthernetClient c;
HttpClient http(c);

void setup() {
// put your setup code here, to run once:

while (Ethernet.begin(mac) != 1)
Serial.println(“Error getting IP address via DHCP, trying again…”);


void loop() {
// main program loop

// read values from sensors
// int sensorValue1 = readvalue(1,0);
// int sensorValue2 = readvalue(1,1);
int sensorValue3 = readvalue(2,0);
int sensorValue4 = readvalue(2,1);
int sensorValue5 = readvalue(3,0);
int sensorValue6 = readvalue(3,1);
int sensorValue7 = readvalue(4,0);
int sensorValue8 = readvalue(4,1);

Serial.println(“sensor readings”);

//create xml string
String xml1 = “<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><![CDATA[”;


String xml2="]]><![CDATA[";


String xml3="]]><![CDATA[";

String xml4="]]><![CDATA[";


String xml5="]]><![CDATA[";


String xml6="]]><![CDATA[";


String xml7="]]>";

//main xml string
String xmlStr;

xmlStr = xml1+sensorValue4+xml2+sensorValue6+xml3+sensorValue8+xml4+sensorValue3+xml5+sensorValue5+xml6+sensorValue7+xml7;

int err = 0;

//err=http.put(kHostname, kPath);

//generate url
String url = “”;“”, 80, url, null);

if(err == 0){

Serial.println(“startedRequest ok”);

//apikey, update this section
http.sendHeader(“apikey”, “uQ9i/ROEOc5Z1AltY3uSUnbMgQtiktP7U4tXXxB1Ep4=”);
http.sendHeader(“deviceData”, xmlStr);


err = http.responseStatusCode();
if (err >= 0)
Serial.print("Got status code: ");

// Usually you’d check that the response code is 200 or a
// similar “success” code (200-299) before carrying on,
// but we’ll print out whatever response we get
Serial.print("Getting response failed: ");
Serial.print("Connect failed: ");


// Wait for a bit before updating things again

Apparently 'null' is not a pre-defined name. Perhaps you should be using 'Null' or 'NULL' or 0.

NULL or null, There's a big difference.

Docedison is right. In C++, NULL is 0. However, that's not always been the case. Back in the old C days, there were near and far pointers and NULL for a far pointer did not mean 0. The X3J11 C standard allows the compiler vendor to define null to be whatever the vendor wishes it to be. The Committee did that because they thought there might be efficiency or technical reasons for it not to be 0 so they left it open for the vendor. Because the Arduino compiler is actually based on a C++ implementation, NULL is zero in the IDE.