I am looking to make repeated programming a little bit easier going forward. The program tells a motor to spin based on the manufacturers program guidelines. The current code will state:
motorname.spin(originallib::directionType::fwd, speed, originallib::velocityUnits::pct);
I want to be able to say:
int main()
{
run(LeftFront,80);
run(RightFront,80);
}
void run(string motorname, double speed )
{
motorname.spin(originallib::directionType::fwd, speed, originallib::velocityUnits::pct);
}
LeftFront and RightFront have been declared in a previous header file as
originallib::motor LeftFront=originallib::motor(originallib::PORT2,
originallib::gearSetting::ratio18_1,
true);
The issue I am running into is:
"error: no member named 'spin' in 'std::basic_string' "
Because the motorname.spin
..... is part of the originallib
How can I go about achieving this?