To lay it out, I am trying to modify a variable declared in the child class inside of a pure virtual method from the parent class. The compiler says it's not in scope. Any help would be great.
Here are the compiler errs:
Locomotion.cpp: In function 'void sendData(NewSoftSerial*, uint8_t*, uint8_t)':
Locomotion.cpp:37: error: 'speed' was not declared in this scope
Locomotion.cpp:38: error: 'isForward' was not declared in this scope
Locomotion.cpp:42: error: 'packetType' was not declared in this scope
Locomotion.cpp:49: error: expected primary-expression before ')' token
Child Class Variable Declaration.
#include "ComInterface.h"
class Locomotion: public ComInterface
{
protected:
uint16_t speed;
bool isForward;
... omitted rest.
Child Class Implementation of pure virtual method that modifies the variable
void sendData(NewSoftSerial *theSerial, uint8_t *ptr, uint8_t length)
{
address = ((byte*)&(speed));
size = sizeof(speed)+sizeof(isForward);
uint8_t CS = size; // need to calculate the size bassed on properties!!!