[solved]error message confusion

Hi all,
I am encountering an error message I do not understand, can anyone point me in the right direction, I cant see anything wrong.
The error message is :- /home/ross/sketchbook/libraries/MenuBackend/MenuBackend.h:195: error: stray ‘\342’ in program

/home/ross/sketchbook/libraries/MenuBackend/MenuBackend.h:195: error: stray ‘\200’ in program

/home/ross/sketchbook/libraries/MenuBackend/MenuBackend.h:195: error: stray ‘\250’ in program

Here is my code :-

#include <MAX6675.h>
#include <MenuBackend.h> //MenuBackend library - copyright by Alexander Brevig
//#include <LiquidCrystal.h> //this library is included in the Arduino IDE
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>
#include <PID_v1.h>
#define RelayPin 7

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
PID myPID(&Input, &Output, &Setpoint,1600,10,10, DIRECT);

int WindowSize = 5000;
unsigned long windowStartTime;

int LED1 = 9; // Status LED Pin
int CS = 10; // CS pin on MAX6675
int SO = 12; // SO pin of MAX6675
int SCK = 13; // SCK pin of MAX6675
int units = 2; // Units to readout temp (0 = raw, 1 = ?C, 2 = ?F)
float temperature = 0.0; // Temperature output variable

// Initialize the MAX6675 Library for our chip
MAX6675 temp(CS,SO,SCK,units);

const int buttonPinLeft = 3; // pin for the Up button
const int buttonPinRight = 2; // pin for the Down button
const int buttonPinEsc = 5; // pin for the Esc button
const int buttonPinEnter = 4; // pin for the Enter button

int lastButtonPushed = 0;

int lastButtonEnterState = LOW; // the previous reading from the Enter input pin
int lastButtonEscState = LOW; // the previous reading from the Esc input pin
int lastButtonLeftState = LOW; // the previous reading from the Left input pin
int lastButtonRightState = LOW; // the previous reading from the Right input pin


long lastEnterDebounceTime = 0; // the last time the output pin was toggled
long lastEscDebounceTime = 0; // the last time the output pin was toggled
long lastLeftDebounceTime = 0; // the last time the output pin was toggled
long lastRightDebounceTime = 0; // the last time the output pin was toggled
long debounceDelay = 300; // the debounce time

LiquidCrystal_I2C lcd(0x27,16,2); // set the LCD address to 0x27 for a 16 chars and 2 line display

//Menu variables
MenuBackend menu = MenuBackend(menuUsed,menuChanged);
//initialize menuitems
MenuItem menu1Item1 = MenuItem("SetPoint");
MenuItem menuItem1SubItem1 = MenuItem("195");
MenuItem menuItem1SubItem2 = MenuItem("196");
MenuItem menuItem1SubItem3 = MenuItem("197");
MenuItem menuItem1SubItem4 = MenuItem("198"); 
MenuItem menuItem1SubItem5 = MenuItem("199"); 
MenuItem menuItem1SubItem6 = MenuItem("200"); 
MenuItem menuItem1SubItem7 = MenuItem("201"); 
MenuItem menuItem1SubItem8 = MenuItem("202"); 
MenuItem menuItem1SubItem9 = MenuItem("203"); 



/* MenuItem menu1Item2 = MenuItem("PID");
MenuItem menuItem2SubItem1 = MenuItem("P+");
MenuItem menuItem2SubItem2 = MenuItem("P-");
MenuItem menuItem2SubItem3 = MenuItem("I+");
MenuItem menuItem2SubItem4 = MenuItem("I-"); 
MenuItem menuItem2SubItem5 = MenuItem("D+");
MenuItem menuItem2SubItem6 = MenuItem("D-"); 
MenuItem menuItem3SubItem3 = MenuItem("Item2SubItem3");
MenuItem menu1Item3 = MenuItem("I");
MenuItem menuItem3SubItem1 = MenuItem("I+");
MenuItem menuItem3SubItem2 = MenuItem("I-");
MenuItem menu1Item4 = MenuItem("D");
MenuItem menuItem4SubItem1 = MenuItem("D+");
MenuItem menuItem4SubItem2 = MenuItem("D-");
*/

void setup()
{
pinMode(buttonPinLeft, INPUT);
pinMode(buttonPinRight, INPUT);
pinMode(buttonPinEnter, INPUT);
pinMode(buttonPinEsc, INPUT);


Serial.begin(9600);

windowStartTime = millis();
//initialize the variables we're linked to

Setpoint = 109;

//tell the PID to range between 0 and the full window size
myPID.SetOutputLimits(0, WindowSize);
//turn the PID on
myPID.SetMode(AUTOMATIC);

lcd.init(); // initialize the lcd 
lcd.backlight(); 
pinMode(LED1, OUTPUT); //thermocouple status


//configure menu
menu.getRoot().add(menu1Item1);
menu1Item1;//.addRight(menu1Item2); //.addRight(menu1Item3);
menu1Item1.add(menuItem1SubItem1).addRight(menuItem1SubItem2).addRight(menuItem1SubItem3).addRight(menuItem1SubItem4).addRight(menuItem1SubItem5).addRight(menuItem1SubItem6).addRight(menuItem1SubItem7).addRight(menuItem1SubItem8).addRight(menuItem1SubItem9);
//menu1Item2.add(menuItem2SubItem1).addRight(menuItem2SubItem2).addRight(menuItem2SubItem3).addRight(menuItem2SubItem4).addRight(menuItem2SubItem5).addRight(menuItem2SubItem6); //.addRight(menuItem3SubItem3);
//menu1Item3.add(menuItem3SubItem1).addRight(menuItem3SubItem2);
//menu1Item4.add(menuItem4SubItem1).addRight(menuItem4SubItem2);

menu.toRoot();
lcd.setCursor(0,0); 
lcd.print("SV");
lcd.setCursor(2,0);
lcd.print( Setpoint );

} // setup()...

void loop()
{
// Read the temp from the MAX6675
temperature = (temp.read_temp());
if(temperature < 0) { 
// If there is an error with the TC, temperature will be < 0
lcd.setCursor(0,0);
lcd.print("Thermocouple Error on CS");
lcd.println( temperature ); 
digitalWrite(LED1, HIGH);
} else {
lcd.setCursor(8,0);
lcd.print("PV");
lcd.setCursor(10,0);
lcd.print( temperature ); 

/* lcd.setCursor(5,0);
lcd.print(" ");
lcd.setCursor(0,1); */
//lcd.print("SV:");
/* lcd.println( Setpoint );
lcd.setCursor(5,1);
lcd.print(" "); */
digitalWrite(LED1, LOW);
}


Input = temperature;
myPID.Compute();

/************************************************
* turn the output pin on/off based on pid output
************************************************/
unsigned long now = millis();
if(now - windowStartTime>WindowSize)
{ //time to shift the Relay Window
windowStartTime += WindowSize;
}
if(Output > now - windowStartTime) digitalWrite(RelayPin,HIGH);
else digitalWrite(RelayPin,LOW);


readButtons(); //I split button reading and navigation in two procedures because 
navigateMenus(); //in some situations I want to use the button for other purpose (eg. to change some settings)

} //loop()...

and the rest of the code :-

void menuChanged(MenuChangeEvent changed){

MenuItem newMenuItem=changed.to; //get the destination menu

lcd.setCursor(0,1); //set the start position for lcd printing to the second row

if(newMenuItem.getName()==menu.getRoot()){
lcd.print("Menu ");
}else if(newMenuItem.getName()=="SetPoint"){
lcd.print("Change Setpoint"); 

}else if(newMenuItem.getName()=="195") {
Setpoint=195;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="196") {
Setpoint=196;
lcd.clear();
lcd.print("SV");
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="197") {
Setpoint=197;
lcd.clear();
lcd.print("SV");
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="198") {
Setpoint=198;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="199") {
Setpoint=199;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint );
}else if(newMenuItem.getName()=="200") {
Setpoint=200;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="201") {
Setpoint=201;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="202") {
Setpoint=202;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="203") {
Setpoint=203;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}}

void menuUsed(MenuUseEvent used) {
/*lcd.setCursor(0,0); 
lcd.print("You used ");
lcd.setCursor(0,1); */
//lcd.print(used.item.getName());
//delay(2000); //delay to allow message reading
//lcd.setCursor(0,0); 
//lcd.print("SP");
// lcd.setCursor(2,0);
//lcd.print( Setpoint );
menu.toRoot(); //back to Main 
}

void readButtons(){ //read buttons status
int reading;
int buttonEnterState=LOW; // the current reading from the Enter input pin
int buttonEscState=LOW; // the current reading from the input pin
int buttonLeftState=LOW; // the current reading from the input pin
int buttonRightState=LOW; // the current reading from the input pin

//Enter button
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinEnter);

// check to see if you just pressed the enter button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonEnterState) {
// reset the debouncing timer
lastEnterDebounceTime = millis();
} 

if ((millis() - lastEnterDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonEnterState=reading;
lastEnterDebounceTime=millis();
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonEnterState = reading;


//Esc button 
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinEsc);

// check to see if you just pressed the Down button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonEscState) {
// reset the debouncing timer
lastEscDebounceTime = millis();
} 

if ((millis() - lastEscDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonEscState = reading;
lastEscDebounceTime=millis();
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonEscState = reading; 


//Down button 
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinRight);

// check to see if you just pressed the Down button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonRightState) {
// reset the debouncing timer
lastRightDebounceTime = millis();
} 

if ((millis() - lastRightDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonRightState = reading;
lastRightDebounceTime =millis();
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonRightState = reading; 


//Up button 
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinLeft);

// check to see if you just pressed the Down button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonLeftState) {
// reset the debouncing timer
lastLeftDebounceTime = millis();
} 

if ((millis() - lastLeftDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonLeftState = reading;
lastLeftDebounceTime=millis();;
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonLeftState = reading; 

//records which button has been pressed
if (buttonEnterState==HIGH){
lastButtonPushed=buttonPinEnter;

}else if(buttonEscState==HIGH){
lastButtonPushed=buttonPinEsc;

}else if(buttonRightState==HIGH){
lastButtonPushed=buttonPinRight;

}else if(buttonLeftState==HIGH){
lastButtonPushed=buttonPinLeft;

}else{
lastButtonPushed=0;
} 
}

void navigateMenus() {
MenuItem currentMenu=menu.getCurrent();

switch (lastButtonPushed){
case buttonPinEnter:
if(!(currentMenu.moveDown())){ //if the current menu has a child and has been pressed enter then menu navigate to item below
menu.use();
}else{ //otherwise, if menu has no child and has been pressed enter the current menu is used
menu.moveDown();
} 
break;
case buttonPinEsc:
menu.toRoot(); //back to main
break;
case buttonPinRight:
menu.moveRight();
break; 
case buttonPinLeft:
menu.moveLeft();
break; 
}

lastButtonPushed=0; //reset the lastButtonPushed variable
}

and the backend :-

void menuChanged(MenuChangeEvent changed){

MenuItem newMenuItem=changed.to; //get the destination menu

lcd.setCursor(0,1); //set the start position for lcd printing to the second row

if(newMenuItem.getName()==menu.getRoot()){
lcd.print("Menu ");
}else if(newMenuItem.getName()=="SetPoint"){
lcd.print("Change Setpoint"); 

}else if(newMenuItem.getName()=="195") {
Setpoint=195;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="196") {
Setpoint=196;
lcd.clear();
lcd.print("SV");
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="197") {
Setpoint=197;
lcd.clear();
lcd.print("SV");
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="198") {
Setpoint=198;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="199") {
Setpoint=199;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint );
}else if(newMenuItem.getName()=="200") {
Setpoint=200;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="201") {
Setpoint=201;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="202") {
Setpoint=202;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}else if(newMenuItem.getName()=="203") {
Setpoint=203;
lcd.clear();
lcd.print("SV"); 
lcd.print( Setpoint ); 
}}

void menuUsed(MenuUseEvent used) {
/*lcd.setCursor(0,0); 
lcd.print("You used ");
lcd.setCursor(0,1); */
//lcd.print(used.item.getName());
//delay(2000); //delay to allow message reading
//lcd.setCursor(0,0); 
//lcd.print("SP");
// lcd.setCursor(2,0);
//lcd.print( Setpoint );
menu.toRoot(); //back to Main 
}

void readButtons(){ //read buttons status
int reading;
int buttonEnterState=LOW; // the current reading from the Enter input pin
int buttonEscState=LOW; // the current reading from the input pin
int buttonLeftState=LOW; // the current reading from the input pin
int buttonRightState=LOW; // the current reading from the input pin

//Enter button
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinEnter);

// check to see if you just pressed the enter button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonEnterState) {
// reset the debouncing timer
lastEnterDebounceTime = millis();
} 

if ((millis() - lastEnterDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonEnterState=reading;
lastEnterDebounceTime=millis();
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonEnterState = reading;


//Esc button 
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinEsc);

// check to see if you just pressed the Down button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonEscState) {
// reset the debouncing timer
lastEscDebounceTime = millis();
} 

if ((millis() - lastEscDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonEscState = reading;
lastEscDebounceTime=millis();
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonEscState = reading; 


//Down button 
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinRight);

// check to see if you just pressed the Down button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonRightState) {
// reset the debouncing timer
lastRightDebounceTime = millis();
} 

if ((millis() - lastRightDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonRightState = reading;
lastRightDebounceTime =millis();
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonRightState = reading; 


//Up button 
// read the state of the switch into a local variable:
reading = digitalRead(buttonPinLeft);

// check to see if you just pressed the Down button 
// (i.e. the input went from LOW to HIGH), and you've waited 
// long enough since the last press to ignore any noise: 

// If the switch changed, due to noise or pressing:
if (reading != lastButtonLeftState) {
// reset the debouncing timer
lastLeftDebounceTime = millis();
} 

if ((millis() - lastLeftDebounceTime) > debounceDelay) {
// whatever the reading is at, it's been there for longer
// than the debounce delay, so take it as the actual current state:
buttonLeftState = reading;
lastLeftDebounceTime=millis();;
}

// save the reading. Next time through the loop,
// it'll be the lastButtonState:
lastButtonLeftState = reading; 

//records which button has been pressed
if (buttonEnterState==HIGH){
lastButtonPushed=buttonPinEnter;

}else if(buttonEscState==HIGH){
lastButtonPushed=buttonPinEsc;

}else if(buttonRightState==HIGH){
lastButtonPushed=buttonPinRight;

}else if(buttonLeftState==HIGH){
lastButtonPushed=buttonPinLeft;

}else{
lastButtonPushed=0;
} 
}

void navigateMenus() {
MenuItem currentMenu=menu.getCurrent();

switch (lastButtonPushed){
case buttonPinEnter:
if(!(currentMenu.moveDown())){ //if the current menu has a child and has been pressed enter then menu navigate to item below
menu.use();
}else{ //otherwise, if menu has no child and has been pressed enter the current menu is used
menu.moveDown();
} 
break;
case buttonPinEsc:
menu.toRoot(); //back to main
break;
case buttonPinRight:
menu.moveRight();
break; 
case buttonPinLeft:
menu.moveLeft();
break; 
}

lastButtonPushed=0; //reset the lastButtonPushed variable
}

Is that MenuBackend.h? It doesn't look like a .h file.

you have most probably copied unicode text into an ascii document.

### is an octal character code

open in notepad and if text looks fine, save-as as ansi text document then rename to .cpp, or .h or whatever it was before

Hi guys, thanks for your replies!
I have just switched to Ubuntu 10.04 (netbook remix).
I have been trying to use tofrodos to convert from the file to something ubuntu will use, but to no avail. Any pointers on how to make this work?

I have figured it out now. I learned a valuable lesson, that when adding a void function, the positioning of the void on the line matters.