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-09
Revision:
12:49813131dd15
Parent:
11:711d3c207e8c
Child:
14:d620415259b1

File content as of revision 12:49813131dd15:

#ifndef Gains_h
#define Gains_h

#include "mbed.h"

class Gains {
    
    public:
    
        Gains(){
            setSwingUpK(0.7);
            setSwingUpD(0.06);
            setCurrentP(4);
            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