first lib

Dependents:   17robo_fuzi 17robo_tokyo_kaede

limit.cpp

Committer:
echo_piyo
Date:
2017-09-24
Revision:
0:9665aacf40f0

File content as of revision 0:9665aacf40f0:


#include "limit.h"
#include "mbed.h"

int limiti(int data, int max, int min){
        if (data > max) {
            return max;
        } else if (data < min) {
            return min;
        }
            return data;
}

float limitf(float data, float max, float min){
        if (data > max) {
            return max;
        } else if (data < min) {
            return min;
        }
            return data;
}