ese519
Dependencies: MRF24J40 mbed-rtos mbed
Actuator.cpp
00001 #include "Actuator.h" 00002 00003 00004 Actuator::Actuator(int m_, int index_, PwmOut motor_, Timeout to_):m(m_),index(index_), motor(motor_), to(to_){} 00005 Actuator::~Actuator(){} 00006 int Actuator::getM(){ 00007 return m; 00008 } 00009 00010 int Actuator::getIndex(){ 00011 return index; 00012 } 00013 00014 PwmOut Actuator::getMotor() 00015 { 00016 return motor; 00017 } 00018 00019 Timeout Actuator::getTo() 00020 { 00021 return to; 00022 } 00023 00024 void Actuator::setM(int m_) 00025 { 00026 m = m_; 00027 00028 } 00029 void Actuator::setIndex(int idx) 00030 { 00031 index = idx; 00032 } 00033 00034 void Actuator::setMotor(double pw) 00035 { 00036 motor = pw; 00037 } 00038 00039 void Actuator::shot() 00040 { 00041 setM(0); 00042 setMotor(0); 00043 } 00044 00045 //void Actuator::updateMotor() 00046 //{ 00047 // if(getM()) getTo().attach(this,&Actuator::shot,0.2); 00048 // } 00049
Generated on Thu Jul 14 2022 21:06:33 by 1.7.2