/* 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
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.
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.
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.