Hi.All
When i run this sketch i get the above error, can anyone help me overcome it.
#include <LiquidCrystal.h>
LiquidCrystal lcd(8,9,4,5,6,7);
float rainfall = 0;
int rain_sensor = 2; //set rainsensor to pin 2
void setup() {
digitalWrite(rain_sensor, LOW); //set pin 2 low
pinMode(rain_sensor, INPUT); //set pin 2 as an input
lcd.begin(16,2);
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“Total Rainfall”);
lcd.setCursor(5,1);
lcd.print(rainfall);
lcd.print(” mm”);
}
float get_rainfall()
{
a: if (digitalRead(rain_sensor) == HIGH)
{
return 0.8;
}
delay(200);
goto a;
}
void loop() {
get_rainfall();
rainfall = rainfall + get_rainfall();
lcd.setCursor(5,1);
lcd.print(rainfall);
lcd.print(” mm”);
delay (1000);
}
[codeArduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Uno"
sketch_may14f:13: error: stray '\342' in program
lcd.print(“Total Rainfall�);
^
sketch_may14f:13: error: stray '\200' in program
sketch_may14f:13: error: stray '\234' in program
sketch_may14f:13: error: stray '\342' in program
sketch_may14f:13: error: stray '\200' in program
sketch_may14f:13: error: stray '\235' in program
sketch_may14f:16: error: stray '\342' in program
lcd.print(� mm�);
^
sketch_may14f:16: error: stray '\200' in program
sketch_may14f:16: error: stray '\235' in program
sketch_may14f:16: error: stray '\342' in program
sketch_may14f:16: error: stray '\200' in program
sketch_may14f:16: error: stray '\235' in program
sketch_may14f:34: error: stray '\342' in program
lcd.print(� mm�);
^
sketch_may14f:34: error: stray '\200' in program
sketch_may14f:34: error: stray '\235' in program
sketch_may14f:34: error: stray '\342' in program
sketch_may14f:34: error: stray '\200' in program
sketch_may14f:34: error: stray '\235' in program
C:\Users\dell\Documents\Arduino\sketch_may14f\sketch_may14f.ino: In function 'void setup()':
sketch_may14f:13: error: 'Total' was not declared in this scope
lcd.print(“Total Rainfall�);
^
sketch_may14f:16: error: 'mm' was not declared in this scope
lcd.print(� mm�);
^
C:\Users\dell\Documents\Arduino\sketch_may14f\sketch_may14f.ino: In function 'void loop()':
sketch_may14f:34: error: 'mm' was not declared in this scope
lcd.print(� mm�);
^
exit status 1
stray '\342' in program
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
][/code]

