temp repo

Dependencies:   mbed

Fork of priustroller_2 by N K

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;
}