Constrain macro
Closed this issue · 2 comments
bask185 commented
The arduino library has a constrain macro which I find quite useful. Perhaps a nice addition?
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
ramdeoshubham commented
Of course !
Can you make a pull request in the macros.h at the end of the file, so that we can acknowledge you as a contributor 😄 ?
Thanks !
ramdeoshubham commented
Ohkay I added it myself. Thanks for your suggestion.
d402c30