test-SimpleMotor.C

00001 #include "Devices/SimpleMotor.H"
00002 #include "Component/ModelManager.H"
00003 #include "Component/ModelComponent.H"
00004 #include "Component/ModelParam.H"
00005 #include "Component/ModelOptionDef.H"
00006 
00007 
00008 int main(const int argc, const char** argv) {
00009         ModelManager *mgr = new ModelManager("TestSimpleMotor");
00010 
00011   nub::soft_ref<SimpleMotor> motor(new SimpleMotor(*mgr));
00012   mgr->addSubComponent(motor);
00013 
00014   //mgr->setOptionValString(&OPT_DevName,  "/dev/ttyUSB0");
00015 
00016   mgr->parseCommandLine(argc, argv, "", 0,0);
00017 
00018   mgr->start();
00019 
00020   int speed = 0;
00021 
00022   while(1)
00023   {
00024     std::cout << "Enter a speed: ";
00025     std::cin >> speed;
00026     motor->setMotor(speed);
00027   }
00028 }
Generated on Sun May 8 08:40:07 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3