Includes the Encoder Header Files
Code:
#include "Encoder.h"
Declared the Encoder Variables
Code:
// Declare Encoder Variables for Input
Encoder *encoderMotor1;
Encoder *encoderMotor2;
We plugged the into Digital Inputs 3,4 & 5,6
Code:
// Encoders
encoderMotor1 = new Encoder(3,4);
encoderMotor2 = new Encoder(5,6);
Created a function in the Initialize Area to start the encoders
Code:
void EncoderInit(void) {
encoderMotor1.Start();
encoderMotor2.Start();
}
Lastly we decided to use the print function to get the encoder values in the debug console
Code:
// Encoder printf
printf("%d %d\n", encoderMotor1->Get(), encoderMotor2->Get());
We receive errors on the lines encoderMotor1.Start(); & encoderMotor2.Start();
Error: Request for member 'Start' in '((BuiltinDefaultCode*)this)->BuiltinDefaultCode::encoderMotor1', which is of non-class type 'Encoder*'
Error: Request for member 'Start' in '((BuiltinDefaultCode*)this)->BuiltinDefaultCode::encoderMotor2', which is of non-class type 'Encoder*'
Any help would be much appreciated... I probably just need another pair of eyes on the code.