I fixed the the Identifier "sensor" is undefined error. The code I changed was sensor->puts("r\r"); to _sensor->puts("r\r"); I forgot the underscore.
As for the first error, I modified the code a little to:
droBot::droBot(MODSERIAL *sensor)
{
_sensor = sensor;
_sensor->baud(38400);
epin = 0;
_sensor->attach(&droBot::rxCallback, MODSERIAL::RxIrq); //Changed to this line
}
void droBot::rxCallback(MODSERIAL_IRQ_INFO *q) { //I forgot the droBot:: infront of the method
MODSERIAL *serial = q->serial;
if ( serial->rxGetLastChar() == '\n') {
//newline_detected = true;
}
}
The new error I received is:
<<quote>
Error: No instance of overloaded function "AjK::MODSERIAL::attach" matches the argument list in "droBot/droBot.cpp", Line: 23, Col: 14
<</quote>>
I am attempting to attach a method to MODSERIAL callback, but it is not working as expected. How do I attach a method to MODSERIAL? My code and errors are listed below.
main file:
.cpp file
.h file
My errors are:
Quote:
Error: Nonstandard form for taking the address of a member function in "droBot/droBot.cpp", Line: 23, Col: 21 Error: No instance of overloaded function "AjK::MODSERIAL::attach" matches the argument list in "droBot/droBot.cpp", Line: 23, Col: 14 Error: Identifier "sensor" is undefined in "droBot/droBot.cpp", Line: 44, Col: 5