Skip to main content

Util

Functions

is_reversed()

Checks whether a smart port is reversed.

  bool is_reversed(double input); 
Parameters
inputA number.

Returns: true if the port it is reversed. Or ``false` if the port it not reversed.


smooth_Joystick_Output()

Applies a smoothing function to joystick input values.

This function smooths the joystick input based on a specified exponent and maximum value. The smoothing function adjusts the joystick value to create a more gradual response.

  float smooth_Joystick_Output(int joystick_value, int exponent, int max_value); 
Parameters
joystick_valueAnalog joystick value.
exponentThe exponent value; a higher exponent provides more smoothing.
max_valueThe maximum value of the joystick. Default value is 127.