bio robot

Dependencies:   MPU6050-DMP QEI_hw mbed-rpc mbed

Fork of MPU6050_Example by Shundo Kishi

Controls/Gains.h

Committer:
amandaghassaei
Date:
2015-12-08
Revision:
11:711d3c207e8c
Parent:
10:769cc457c3a4
Child:
12:49813131dd15

File content as of revision 11:711d3c207e8c:

#ifndef Gains_h
#define Gains_h

#include "mbed.h"

class Gains {
    
    public:
    
        Gains(){
            setSwingUpK(0.7);
            setSwingUpD(0.06);
            setCurrentP(30);
            setCurrentD(0);
        }
        
        void setPC(Serial *pc){
            _pc = pc;
        }
        
        void setSwingUpK(float k){
            _swingUpK = k;
        };
        void setSwingUpD(float d){
            _swingUpD = d;
        };
        void setCurrentP(float p){
            _currentP = p;
        };
        void setCurrentD(float d){
            _currentD = d;
        };
        
        float getSwingUpK(){
            return _swingUpK;
        };
        float getSwingUpD(){
            return _swingUpD;
        };
        float getCurrentP(){
            return _currentP;
        };
        float getCurrentD(){
            return _currentD;
        };
    
    private:
    
        Serial *_pc;
    
        float _swingUpK;
        float _swingUpD;
        float _currentP;
        float _currentD;
    
};

#endif