printSerial error

/* Virtual Etch A Sketch using 2 Potentiometers
This program reads two analog sensors via serial and draws their values as X and Y
Arduino Code
Christian Nold, 22 Feb 06
*/
int potPin = 4; // select the input pin for the potentiometer
int potPin2 = 5; // select the input pin for the potentiometer
int ledPin = 13; // select the pin for the LED
int val = 0; // variable to store the value coming from the sensor
int val2 = 0; // variable to store the value coming from the sensor
void setup() {
beginSerial(9600);
pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT
}
void loop() {
val = analogRead(potPin); // read the value from the sensor
val2 = analogRead(potPin2); // read the value from the sensor
printString(“A”);
printInteger(val); // Example identifier for the sensor
serialWrite(10);
printString(“B”);
printInteger(val2); // Example identifier for the sensor
serialWrite(10);

}

Getting these errors :

sketch_oct20b:17: error: stray '\' in program
sketch_oct20b:17: error: stray '\' in program
sketch_oct20b:20: error: stray '\' in program
sketch_oct20b:20: error: stray '\' in program
sketch_oct20b.cpp: In function 'void setup()':
sketch_oct20b:11: error: 'beginSerial' was not declared in this scope
sketch_oct20b.cpp: In function 'void loop()':
sketch_oct20b:17: error: 'u201cA' was not declared in this scope
sketch_oct20b:17: error: 'printString' was not declared in this scope
sketch_oct20b:18: error: 'printInteger' was not declared in this scope
sketch_oct20b:19: error: 'serialWrite' was not declared in this scope
sketch_oct20b:20: error: 'u201cB' was not declared in this scope

Please help

printString(“A”);

Just a guess.

beginSerial(9600);

Fairly obvious.

You need to quit copying code from whatever crappy site you are getting it from. Or copy ALL of the code.

beginSerial(9600);

There is no, and never has been, a beginSerial function. There is a Serial.begin() method.

well, it's from getting started with arduino book. and i copied all of it.

Do you have a shredder?

well, it's from getting started with arduino book. and i copied all of it.

Which one? What edition?

PDF one.
So i corrected the Serial.begin() command but still showing errors…:frowning:

http://www.google.co.in/url?sa=t&rct=j&q=getting%20started%20with%20arduino%20pdf&source=web&cd=1&sqi=2&ved=0CBsQFjAA&url=http%3A%2F%2Fwebzone.k3.mah.se%2Fprojects%2Flab%2FFolder%2Findex.aspx%3Ffile%3D32%26function%3Dtext&ei=PiqgTqaXJtHtrQethan7Ag&usg=AFQjCNGjdyW2g-hEmLJL-z5wqg5zmOHCbg

This is the download link. The code is on the very last page. Processing is also included but the code for it is also giving problems. Can anyone give me the correct code for both of them. Please.

You need to correct the prints and the double quote characters.

Do you have a shredder?

No. Why ?

How ? (Sorry for being super n00b there)

Quote Do you have a shredder? No. Why ?

Pity. It would have saved a lot of time and effort.

http://arduino.cc/en/Reference/Serial

This is the download link.

Did you notice on the cover page that it says Beta. That means that it is a draft version of the book. The book is sold, so bootleg copies of a pre-release copy are useless for learning. Delete the copy you made, shred anything you have printed from it, and BUY the damned book.

So you mean that the code written in this pdf version is incorrect ?

So you mean that the code written in this pdf version is incorrect ?

Let's ask the compiler.

Never Mind the compiler, can you Please Please give me the arduino and processing both codes. Need this project urgently. ThankYou.

Can't help with the Processing (though I suspect the double quotes will be an issue there too), but post the Arduino code that you're stuck on, and we'll try to help. I'm afraid it's only urgent for you.

Can you please please give me the correct code for this thing. Really need it. Please help !

Serial.print("A");

You can manage the rest.

Got the serial print one but it sticks on the print integer and serial write. Any help for that ?