Floating Point Values and Digits after Decimal Point

In the ti_rover module, and TI-Innovator objects, various parameters are represented by floating point values. Numerous routines also return floating point values. These values are formatted in a specific manner for sending to the TI-Innovator™ Hub, and return values that represent sensor readings and other floating point return values are rounded to a specific number of digits after the decimal point for return.

The following information details these constraints.

Floating Point Return Values

Any module returning sensor readings, and other values that are represented by a floating point value will have their value rounded to 3 decimal positions to the right of the decimal point.

The following table shows the formatting for floating point values being sent for a variety of parameters to modules.

Digits to right of decimal point

Parameter Represents...

Python Format

1

Speed, Position (servos)

:.1f

1

Resistance (calibration)

:.1f

2

Seconds (time, duration)

:.2f

2

Frequency (blink, sound)

:.2f

2

Grid Units (TI-Rover)

:.2f

2

Position (TI-Rover)

:.2f

3

Distance (TI-Rover)

:.3f

3

Speed (TI-Rover)

:.3f

3

Angles (TI-Rover)

:.3f

3

Range (min, max)

:.3f

9

Calibration Coeffs

:.9e