Programming Error

I want my HC-SR04 to display its reading on a 16x2 LCD

This is the code:

/*
Coded By: http://electronicsproject.org
*/
#define trigPin 7
#define echoPin 8
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
lcd.begin(16, 2);
lcd.print(“electronics”);
lcd.setCursor(0, 1);
lcd.print(“project.org”);
delay(2000);
lcd.clear();
lcd.print(“Welcome To”);
lcd.setCursor(0, 1);
lcd.print(“Distnance Meter”);
delay(2000);
lcd.clear();
lcd.print(“Designed by:”);
lcd.setCursor(0, 1);
lcd.print(“ElectronicsProject”);
}
void loop() {
int timetaken, dist;
lcd.clear();
lcd.print(“Distance in CM:”);
digitalWrite(trigPin, HIGH);
delayMicroseconds(1000);
digitalWrite(trigPin, LOW);
timetaken = pulseIn(echoPin, HIGH);
dist = (timetaken/2) * 0.034049 ;
if (dist >= 300 || dist <= 0){
lcd.setCursor(0, 1);
lcd.print(“Out Of Range”);
}
else
{
lcd.setCursor(0, 1);
lcd.print(dist);
}
delay(500);
}

This is the error message:

Arduino: 1.6.4 (Windows 7), Board: “Arduino Uno”

sketch_jan04a:12: error: stray ‘’ in program
sketch_jan04a:12: error: stray ‘’ in program
sketch_jan04a:14: error: stray ‘’ in program
sketch_jan04a:14: error: stray ‘’ in program
sketch_jan04a:17: error: stray ‘’ in program
sketch_jan04a:17: error: stray ‘’ in program
sketch_jan04a:19: error: stray ‘’ in program
sketch_jan04a:19: error: stray ‘’ in program
sketch_jan04a:22: error: stray ‘’ in program
sketch_jan04a:22: error: stray ‘’ in program
sketch_jan04a:24: error: stray ‘’ in program
sketch_jan04a:24: error: stray ‘’ in program
sketch_jan04a:29: error: stray ‘’ in program
sketch_jan04a:29: error: stray ‘’ in program
sketch_jan04a:37: error: stray ‘’ in program
sketch_jan04a:37: error: stray ‘’ in program
sketch_jan04a.ino: In function ‘void setup()’:
sketch_jan04a:12: error: ‘u201celectronics’ was not declared in this scope
sketch_jan04a:14: error: ‘u201cproject’ was not declared in this scope
sketch_jan04a:17: error: ‘u201cWelcome’ was not declared in this scope
sketch_jan04a:19: error: ‘u201cDistnance’ was not declared in this scope
sketch_jan04a:22: error: ‘u201cDesigned’ was not declared in this scope
sketch_jan04a:24: error: ‘u201cElectronicsProject’ was not declared in this scope
sketch_jan04a.ino: In function ‘void loop()’:
sketch_jan04a:29: error: ‘u201cDistance’ was not declared in this scope
sketch_jan04a:37: error: ‘u201cOut’ was not declared in this scope
stray ‘’ in program

This report would have more information with
“Show verbose output during compilation”
enabled in File > Preferences.

Please help…

please read "how to post to this forum", and go and edit your first post so the code is inside code tags so we can read it.

It should look like this:

... code here....

I think you posted the wrong code. This compiles fine for me. None of the strings called out as errors appear in this listing.

Put the sketch in a directory by itself. It looks like you have other files in the directory.

Never mind I got it....

:slight_smile: Hey I too Got the same error at starting. I tried this forum but didn’t find the right solution. I tried Outside also.

Finally After striving hard, I came to end with a “SIMPLE” “SOLUTION”.

To my friends in INDIA, I would suggest you to get this programmer From : EBAY.IN HERE ``
http://www.ebay.in/itm/CP2102-USB-to-TTL-USB-UART-serial-port-converter-module-ARDUINO-PROGRAMMER-/301930059278?hash=item464c6f160e:g:dmcAAOSw~OVW0DLF