Hey all.
After messing a bit around with arduino Libraries, i've run into some trouble, creating standard methods is easy enough, however when it concerns integers I run into some trouble.
this is what my code looks like:
/*prototypeGUI.h meant for C17's exercise prototype*/
#include "Arduino.h"
#include "prototypeGUI.h"
#include "serialLCDFunctions.h"
//prototypeGUI proto;
void prototypeGUI::startScreen(){
//Definition af startskærm
serialLCDFunctions::selectLineOne();
Serial.print(" Welcome to C17's");
delay(10);
serialLCDFunctions::selectLineTwo();
Serial.print(" Exercise prototype");
delay(10);
serialLCDFunctions::selectLineFour();
Serial.print(" >OK<");
delay(10);
}
void prototypeGUI::prototypeMenu(){
//Definition af menuen
serialLCDFunctions::selectLineOne();
Serial.print(" Choose exercise");
delay(10);
serialLCDFunctions::selectLineTwo();
Serial.print(" Calibration"); //Dunno if this is something that is needed
delay(10);
serialLCDFunctions::selectLineFour();
Serial.print(" Turn off");
delay(10);
}
int numberReps;
int numberBends;
void prototypeGUI::eWeightLift(){
//Definition af vægtløftøvelsen
serialLCDFunctions::selectLineOne();
Serial.print("Start exercise/pause");
delay(10);
serialLCDFunctions::selectLineTwo();
Serial.print("Nr. of bends:" + numberBends +);//Some integer containing a loop which keeps track of how many bends you have made. (NumberBends is just something i made up)
delay(10);
serialLCDFunctions::selectLineThree();
Serial.print("Nr. of reps.:" + numberReps); //Some integer containing a loop which keeps track of how many reps you have taken. (NumberReps is just something i made up)
delay(10);
serialLCDFunctions::selectLineFour();
Serial.print(" Back");
delay(10);
}
and the .h:
/*prototypeGUI.h meant for C17's exercise prototype*/
#ifndef prototypeGUI_h
#define prototypeGUI_h
#include "Arduino.h"
#include "serialLCDFunctions.h"
class prototypeGUI
{
public:
void startScreen();
void prototypeMenu();
void eWeightLift();
private:
};
#endif
But the integers used, namely:
numberReps;
and
numberBends;
makes the library not work, the specific error it gives is:
/home/rasmus/sketchbook/libraries/prototypeGUI/prototypeGUI.cpp: In member function ‘void prototypeGUI::eWeightLift()’:
/home/rasmus/sketchbook/libraries/prototypeGUI/prototypeGUI.cpp:45:45: error: expected primary-expression before ‘)’ token
and I can't really see what im doing wrong here other than I am completely missing something about how I am supposed to put these integers into all of it. Please notice, that i should be able to change the integers values from my sketch.
thanks for looking this over
