Bayley Wang
/
analoghalls5
wut
throttle.cpp
- Committer:
- bwang
- Date:
- 2015-03-02
- Revision:
- 3:0a2396597e0d
- Parent:
- 1:1f58bdcf2956
File content as of revision 3:0a2396597e0d:
#include "includes.h" #include "sensors.h" Throttle::Throttle(PinName pin, float min, float max) { _in = new AnalogVoltageSensor(pin, 1.0f); _min = min; _max = max; } float Throttle::GetThrottle() { float v = _in->GetVoltage(); return (v - _min) / (_max - _min); }