|ROBOTC has a rich set of functionality for drawing text and shapes on the LCD screen. The NXT is equipped with a 100 wide by 64 pixels high display.
- The bottom left corner is point (0, 0) and the top right corner of the display is point (99, 63).
- There are eight text lines numbers 0 to 7. 0 is the top line and 7 is the bottom line of the display.
|%d or %i
||Signed decimal integer
||Scientific notation (mantise/exponent) using e character
||Scientific notation (mantise/exponent) using E character
||Decimal floating point number
||String of characters
||Unsigned hexadecimal integer
||Unsigned hexadecimal integer (capital letters)
NOTE on Displaying Digits:
When displaying floats, for example, you can tell ROBOTC how many decimals places to display. This is standard across all 'C' - like programing languages. For example, if your float is PI (3.14159265), but you only want to dispay "3.14", your string should contain, "%1.2f".
The number before the decimal is how many digits before the decimal you wish to display, while the number after the decimal is how many digits after the decimal you wish to display. So "%1.2f" tells us to display one digit before the decimal and two digits after the decimal, with "3.14" as the final result.
The tag can also contain flags, width, .precision and modifiers sub-specifiers, which are optional and follow these specifications:
||Prints a decimial integer
||Prints a decimal integer, at least 6 characters wide
||_ _ _ _ 50
||Prints a floating point number
||Prints a floating point number, at least 6 characters wide
||_ _ _ 50.5
||Prints a floating point number, with at least 2 decimal places
||Prints a floating point number, with at least 6 characters wide and 2 decimal places
Note: Underscore ( _ ) character denotes a space.