Here is a very simple sketch:
void setup()
{
Serial.begin(9600); // debug write to the USB
}
void loop()
{
int vR = 0; // reference voltage
int vP = 0; // potentiometer voltage
int x = 0; // difference between the two
vR = analogRead(A0); // read vR to compare with vP
vP = analogRead(A1); // read vP to compare with vR
x = vR – vP; // calculate the difference
Serial.print(x); // write difference to console
}
Here are the compiler error messages:
minus:17: error: stray '' in program
minus.ino: In function 'void loop()':
minus:17: error: expected `;' before 'u2013'
If I comment out the
x = vR – vP; // calculate the difference
line (17), it compiles OK.
I tried to search existing posts but didn't find an answer.
What gives???