Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Obj_depot.cpp
00001 #include "Obj_depot.h" 00002 00003 extern Motor motorL; 00004 extern Motor motorR; 00005 extern bool interruption; 00006 00007 Obj_depot::Obj_depot(float x, float y, float theta, AX12 *ax12_pince) 00008 :Objectif(x,y,theta) 00009 { 00010 this->ax12_pince = ax12_pince; 00011 desactivate(); 00012 } 00013 00014 void Obj_depot::run() 00015 { 00016 ax12_pince->setMaxTorque(MAX_TORQUE); 00017 wait(0.1); 00018 ax12_pince->setGoal(PINCE_OUVERTE); 00019 wait(1); 00020 00021 if(!interruption) 00022 { 00023 motorL.setSpeed(-0.3); 00024 motorR.setSpeed(-0.3); 00025 wait(0.5); 00026 motorL.setSpeed(0); 00027 motorR.setSpeed(0); 00028 } 00029 00030 done = true; 00031 } 00032 00033 int Obj_depot::isActive() 00034 { 00035 if(!active) 00036 return false; 00037 00038 if(ax12_pince->getGoal() == PINCE_OUVERTE) 00039 return false; 00040 00041 return true; 00042 }
Generated on Wed Jul 13 2022 04:59:28 by
1.7.2