Bayley Wang
/
priustroller_3
temp repo
Fork of priustroller_2 by
Diff: core/motor.cpp
- Revision:
- 11:dccbaa9274c5
- Parent:
- 6:99ee0ce47fb2
- Child:
- 29:cb03760ba9ea
diff -r b4abecccec7a -r dccbaa9274c5 core/motor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/motor.cpp Sun Mar 08 08:37:38 2015 +0000 @@ -0,0 +1,31 @@ +#include "includes.h" +#include "core.h" +#include "sensors.h" + +Motor::Motor(CurrentSensor *sense_c, CurrentSensor *sense_b, PositionSensor *sense_p, TempSensor *sense_t) { + _sense_c = sense_c; + _sense_b = sense_b; + _sense_p = sense_p; + _sense_t = sense_t; +} + +float Motor::GetCurrentC() { + return _sense_c->GetCurrent(); +} + +float Motor::GetCurrentB() { + return _sense_b->GetCurrent(); +} + +float Motor::GetPosition() { + return _sense_p->GetPosition(); +} + +float Motor::GetTemp() { + return _sense_t->GetTemp(); +} + +void Motor::Config(int num_poles, float kv) { + _num_poles = num_poles; + _kv = kv; +} \ No newline at end of file