Smartcar Shield
|
Functions | |
template<typename AnyNumber > | |
constexpr AnyNumber | getAbsolute (AnyNumber number) |
Gets the absolute of the supplied number. More... | |
template<typename AnyNumber > | |
constexpr AnyNumber | getConstrain (AnyNumber number, AnyNumber min, AnyNumber max) |
Limit the number between a range. More... | |
template<typename AnyNumber > | |
AnyNumber | getMedian (AnyNumber unsortedNumbers[], const unsigned int &arraySize) |
Gets the median value out of the supplied number array. More... | |
template<typename AnyNumber > | |
constexpr AnyNumber | getMap (AnyNumber valueToMap, AnyNumber fromLow, AnyNumber fromHigh, AnyNumber toLow, AnyNumber toHigh) |
Maps a value from a range to another. More... | |
constexpr bool | areAlmostEqual (float a, float b) |
Compares two floating point numbers. More... | |
|
constexpr |
Compares two floating point numbers.
a | The first floating point number to compare |
b | The second floating point number to compare |
true
if the two numbers are amost equal, false otherwiseExample:
Definition at line 124 of file Utilities.hpp.
|
constexpr |
Gets the absolute of the supplied number.
number | The number to get the absolute of |
Example:
Definition at line 24 of file Utilities.hpp.
|
constexpr |
Limit the number between a range.
number | The number to limit |
min | The minimum limit of the range |
max | The maximum limit of the range |
Example:
Definition at line 46 of file Utilities.hpp.
|
constexpr |
Maps a value from a range to another.
Implemented as a templetized map
of Arduino.
valueToMap | The value to be mapped |
fromLow | The lower limit of the initial range |
fromHigh | The upper limit of the initial range |
toLow | The lower limit of the final range |
toHigh | The higher limit of the final range |
Example:
Definition at line 104 of file Utilities.hpp.
AnyNumber smartcarlib::utils::getMedian | ( | AnyNumber | unsortedNumbers[], |
const unsigned int & | arraySize | ||
) |
Gets the median value out of the supplied number array.
unsortedNumbers | An array containing numbers |
arraySize | Amount of numbers contained in the array |
Example:
Definition at line 66 of file Utilities.hpp.