![]() |
Autodrone
Multi-Domain Vehicle
|
This file contains random useful functions. More...
#include "board.h"Functions | |
| float | constrain (float input, float minValue, float maxValue) |
| Constrains an input between two values. More... | |
| uint16_t | constrain16 (uint16_t input, uint16_t minValue, uint16_t maxValue) |
| Constrains an input uint16_t between two values. More... | |
| float | standardRadianFormat (float angle) |
| Puts a value in standard radian format. More... | |
| uint16_t | dshot3dFormat (int16_t rxCmd) |
| Formats values from an iBus receiver for 3D mode. More... | |
| float | stringToFloat (const char *p) |
| Simple and fast atof (ascii to float) function. More... | |
This file contains random useful functions.
| float constrain | ( | float | input, |
| float | minValue, | ||
| float | maxValue | ||
| ) |
Constrains an input between two values.
| input | Value to be constrained. |
| minValue | Lower threshold. |
| maxValue | Upper threshold. |
| uint16_t constrain16 | ( | uint16_t | input, |
| uint16_t | minValue, | ||
| uint16_t | maxValue | ||
| ) |
Constrains an input uint16_t between two values.
| input | Value to be constrained. |
| minValue | Lower threshold. |
| maxValue | Upper threshold. |
| uint16_t dshot3dFormat | ( | int16_t | rxCmd | ) |
Formats values from an iBus receiver for 3D mode.
| rxCommand | Value from iBus receiver. |
| float standardRadianFormat | ( | float | angle | ) |
Puts a value in standard radian format.
| angle | Value to be formatted. |
| float stringToFloat | ( | const char * | p | ) |
Simple and fast atof (ascii to float) function.
Executes about 5x faster than standard MSCRT library atof() -An attractive alternative if the number of calls is in the millions. -Assumes input is a proper integer, fraction, or scientific format. -Matches library atof() to 15 digits (except at extreme exponents). -Follows atof() precedent of essentially no error checking. 09-May-2009 Tom Van Baak (tvb) www.LeapSecond.com
| *p | Pointer to string. |