Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: 17robo_fuzi 17robo_tokyo_kaede
limit.cpp
00001 00002 #include "limit.h" 00003 #include "mbed.h" 00004 00005 int limiti(int data, int max, int min){ 00006 if (data > max) { 00007 return max; 00008 } else if (data < min) { 00009 return min; 00010 } 00011 return data; 00012 } 00013 00014 float limitf(float data, float max, float min){ 00015 if (data > max) { 00016 return max; 00017 } else if (data < min) { 00018 return min; 00019 } 00020 return data; 00021 }
Generated on Wed Jul 13 2022 23:48:40 by
