Compilation error

can anyone help fix a compilation error on this code

#include <SoftwareSerial.h>
#include <LiquidCrystal.h> // Importing LCD Library;
#include <GSM.h>
/*

  • RS: Pin 10
  • EN: Pin 11
  • D4: Pin 2
  • D5: Pin 3
    • D6: Pin 4
  • D7: Pin 5
    */

LiquidCrystal lcd(10, 11, 2, 3, 4, 5); //lcd display pin
char mobileNumber; // Will hold the incoming character from the GSM shield
SoftwareSerial SIM900(6, 7);
const int voltageSensor = A0; // voltage pin
const int currentSensor = A1; // current pin
//float getVPP;
int mVperAmp = 66; // use 100 for 20A Module and 66 for 30A Module
double sumWH = 0.000;
float WH = 0;//energy consumption in watt hour
double sumRand = 0.00;//Total energy consumption in Rand
float Rand = 0;//energy consumption in Rand
double Voltage = 0.0;//AC supply peak voltage
double vrms = 0;//AC supply rms voltage
double current = 0;//load peak current
double irms = 0;//load rms current
double power = 0;//
void setup()
{
Serial.begin(19200);
SIM900.begin(19200);
pinMode(13,OUTPUT);
delay(800);
Serial.print(“SIM900 ready…”);
// At command to set SIM900 to SMS mode
SIM900.print(“AT+CMGF=1\r”); // turn on caller ID notification , to get missed call number
delay(100);
// set module to send SMS data to serial out upon receipt
SIM900.print(“AT+CNMI=2,2,0,0,0\r”);
lcd.begin(16,4); // Display Columms, Rows and Size
lcd.clear();
delay(800);
}
// Used to send Total Energy Consumption Billing to Customer
boolean sendBilling()
{
delay(20000); // delay time to send SMS (20s)
Serial.print(“SIM900 ready…”);
SIM900.print(“AT+CMGF=1\r”);
delay(100);
//SIM900.println(“AT+CMGF=1”); // Setting the GSM Module in Text mode
delay(2000);
SIM900.println(“AT+CMGS=”+27xxxxxxxxxxxx"");// Sending Energy Consumption to Customer’s Mobile Number
delay(100);
SIM900.print(“Welcome to smart energy meter”);
SIM900.print(’\n’);
SIM900.print(’\n’);// break the text
SIM900.print(“Dear Customer, Your Energy Consumption is :”);
SIM900.print(sumWH);
SIM900.print(" and Total Billing is R ");
SIM900.print(sumRand);
delay(100);
SIM900.println((char)26); // ASCII code of CTRL+Z
delay(100);
SIM900.println();
delay(5000); //time module to send SMS
}
boolean energyCalculations()
{
// getting voltage from Input PIN
Voltage = analogRead(voltageSensor);
vrms = (Voltage / 2.0) * 0.707 * 677.1; //find total voltage
vrms=vrms/1000;
if (vrms < 150.1)
{
vrms=0.0;
}
Serial.print("VOLTAGE : ");
Serial.print(vrms);
Serial.println(“Volt”);
// getting current from Input PIN
current = getVPP(1);

irms = (current / 2.0) * 0.707 * 1000 / mVperAmp;

if (irms < 0.1)
{
irms=0.0;
}

Serial.print(“CURRENT :”);
Serial.print(irms);
Serial.println(“Amps”);
power=(vrms * irms );
Serial.print(“POWER :”);
Serial.print(power);
Serial.println(“W”);
// energy consume in hour
WH = (power / 3600);
Serial.print(“ENERGY CONSUMED :”);
Serial.print(WH);
Serial.println(“Watt-Hour”);
sumWH = sumWH + WH;
Serial.print(“TOTAL ENERGY CONSUMED :”);
Serial.print(sumWH);
Serial.println(“Watt-Hour”);
Rand = getReading();
Serial.print(“ENERGY CONSUMED IN Rand :”);
Serial.print(Rand);
Serial.println(“R “);
sumRand = sumRand + Rand ;
Serial.print(“TOTAL ENERGY CONSUMED IN Rand :”);
Serial.println(“R “);
Serial.print(sumRand);
Serial.println(””); // print the next sets of parameter after a blank line
}
void loop()
{
energyCalculations();
gsm();
if(SIM900.available() > 0)
{
Serial.println(“Inside SIM900 avaialble”);
Serial.write(SIM900.read());
delay(200);
}
}
boolean gsm()
{
//Serial.println(“AT+CMGF=1”);
if(SIM900.available() > 0)
{
//Serial.println(“SIM900 is available”);
delay(10);
mobileNumber = SIM900.read();
//Serial.print(“AT+CMGS=”+27xxxxxxxxxxxx””);
if(mobileNumber == ‘C’)

{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘O’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘N’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘S’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘U’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘M’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘P’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘T’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘I’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘O’)
{
delay(10);
Serial.print(mobileNumber);
mobileNumber = SIM900.read();
if(mobileNumber == ‘N’)

{
delay(10);
Serial.print(mobileNumber);
Serial.print("… Request Received\n");

//Serial.println("+27xxxxxxxxxx!");
Serial.println(“Sending Billing to Customer”);
//delay(90000);
sendBilling();
//the asking billing it’s “CONSUMPTION”
}
}
}
}
}
}
}

}
}
}

}
sendBilling();
}
lcd.setCursor(16,1); // set the cursor outside the display count
lcd.print(" "); // print empty character
delay(500);
/conditions for power control/
//power=2;
if (power<=2000)
{
digitalWrite (13,HIGH);

lcd.setCursor(0,0); // set the cursor at 1st col and 1st row
lcd.print(“Volt =”);
lcd.print(vrms);
lcd.print("v ");
lcd.setCursor(0,1);
lcd.print(“Cur =”);
lcd.print(irms);
lcd.print(“A”);
lcd.setCursor(20,0); // set the cursor at 1st col and 2nd row
lcd.print(“Pow =”);
lcd.print(power);
lcd.print(“W”);
delay(4000);
lcd.clear(); // clear the screen
lcd.setCursor(0,0); // set the cursor at 1st col and 1st row
lcd.print("Energy= ");
lcd.print(WH);
lcd.print(“WH”);
lcd.setCursor(0,1); // set the cursor at 1st col and 2nd row
lcd.print(“Cost=R”);
lcd.print(Rand);
delay(4000);
lcd.clear(); // clear the screen
lcd.setCursor(0,0); // set the cursor at 1st col and 1st row
lcd.print(“Total Pow=”);
lcd.print(sumWH);
lcd.print(“WH”);
lcd.setCursor(0,1); // set the cursor at 1st col and 2nd row
lcd.print(“Total cost=R”);
lcd.print(sumRand);
delay(4000);
}

if (power>2000)
{
lcd.clear();
digitalWrite (13,LOW);
//delay(10000);
lcd.setCursor(6,1);
Serial.print(“Overload”);
lcd.print(“Overload”);
delay (10000);
}
}
// current sensor and voltage sensor
float getVPP(int pinValue)
{
pinValue = 0; // means it is Voltage Input ,
pinValue = 1; //means it is Current Input
float result;

int readValue; // value read from the sensor
int maxValue = 0; // store max value here
int minValue = 1024; // store min value here

uint32_t start_time = millis();
while((millis() - start_time) < 1000) //sample for 1 Sec
{
if(pinValue == 0)
{
// reading Voltage Input PIN
readValue = analogRead(voltageSensor);
}
else if(pinValue == 1)
{
// reading Current Input PIN
readValue = analogRead(currentSensor);
}

// see if you have a new maxValue
if (readValue > maxValue)
{
/record the maximum sensor value/
maxValue = readValue;
}
if (readValue < minValue)
{
/record the maximum sensor value/
minValue = readValue;
}
}

// Subtract min from max
result = ((maxValue - minValue) * 5.0) / 1024.0;

return result;
}
//Energy cost

float getReading()
{
float solution;
if(sumWH <= 50)
solution = (WH * 3.15);
if(( sumWH > 50 ) && ( sumWH <= 100 ))
solution = ( WH * 3.60 );
if(( sumWH > 100 ) && (sumWH <= 250))
solution = (WH * 4.25);
if(sumWH > 250)
solution = (WH * 5.20);
return solution;
}

can you post the error?

and post the code inside the code tags “</>” top left

Read the how to use this forum-please read sticky to see how to properly post code. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

I guess the actual error you get is a secret? When you take your car to the mechanic, do you simply tell him "it doesn't work", without telling him WHAT doesn't work?

Regards,
Ray L.

I
find
your
code
very
difficult
to
read.

Please remember to use code tags when posting code.
And use the auto-format tool in the IDE before posting code.