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.
Fork of priustroller_2 by
core/motor.cpp
- Committer:
- nki
- Date:
- 2015-03-14
- Revision:
- 29:cb03760ba9ea
- Parent:
- 11:dccbaa9274c5
- Child:
- 30:2b6d426f3bfc
File content as of revision 29:cb03760ba9ea:
#include "includes.h" #include "core.h" #include "sensors.h" Motor::Motor(PositionSensor *sense_p, TempSensor *sense_t) { _sense_p = sense_p; _sense_t = sense_t; } float Motor::GetCurrentC() { return (float) global_ic / 4095.0f; } float Motor::GetCurrentB() { return (float) global_ib / 4095.0f; } 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; }