Inverted Pendulum / Mbed 2 deprecated IP-Interface

Dependencies:   mbed QEI

pot/pot.cpp

Committer:
dlweakley
Date:
2016-11-14
Revision:
11:ed9539245ea0
Parent:
8:2abfdbf5a3b8
Child:
12:65392ee77300

File content as of revision 11:ed9539245ea0:

#include "mbed.h"
#include "pot.h"

Pot::Pot(PinName _pin, int offset) : angle(_pin) {
    offset=offset;
}

float Pot::get_angle(){
    float a = angle.read()*360; 
    return a;  
}
float Pot::get_voltage(){
    float a = angle.read(); 
    return a;  
}
void Pot::set_offset(int angle){
     offset = angle; 
}