Hello,
I'm new to programming in cpp compared to c.
I have declared the following class:-
class RAMLCD
{
char RAMBuffer[32];
char RAMCursor;
public:
RAMLCD() //Constructor
{
cls();
}
void update(SparkfunSerialLCD* LCD);
void cursor(int x, int y);
void cls(void);
void pstring(char * PString);
};
This class is used to have a RAM buffer mirroring the contents of an LCD.
update() sends the buffer on a byte by byte basis to the LCD. (Sparkfun serial)
I have declared an instance of this class:-
RAMLCD RLCD;
and have declared and instance of the LCD:-
SparkfunSerialLCD LCD(p13);
In my main, I can call the update manually
RLCD.update(&LCD);
But my question what is the syntax for me to attach this function to a Ticker so that I can call it automatically?
Ticker LCDTick;
LCDTick.attach(&RLCD.update(), 0.01);
This gives a compilation error.
I look forward to your comments.
Regards
Phil
Hello, I'm new to programming in cpp compared to c.
I have declared the following class:-
This class is used to have a RAM buffer mirroring the contents of an LCD. update() sends the buffer on a byte by byte basis to the LCD. (Sparkfun serial)
I have declared an instance of this class:-
RAMLCD RLCD;
and have declared and instance of the LCD:-
SparkfunSerialLCD LCD(p13);
In my main, I can call the update manually
RLCD.update(&LCD);
But my question what is the syntax for me to attach this function to a Ticker so that I can call it automatically?
Ticker LCDTick;
LCDTick.attach(&RLCD.update(), 0.01);
This gives a compilation error.
I look forward to your comments. Regards Phil