Min()

From Microduino Wiki
Jump to: navigation, search
#define min(a, b) ((a)<(b)?(a):(b))

Take the minimum value.

Take the minimum between two numbers. For example:

sensVal = min(sensVal, 100); // assigns sensVal to the smaller of sensVal or 100
                             // ensuring that it never gets above 100.

[Return to Arduino Syntax Manual]