If you are going to use the printer, it is a good idea to clear it near the start of your program. Then, if you run the program several times, the program will always start out with a clear printer, and you won't clutter your view with the printing output from pervious program runs.
The printer is cleared with the command clearPrinter:
Values are printed with the command printNumber. This command accepts a value and sends it to the printer. By default values are rounded to two decimal places, although this can be changed. Here is what the command printNumber looks like:
The above code would print the number 2.35:
You can control the number of decimals that will be printed by using the command setNumDecimals. The following command would set the number of decimals to 3:
After the above command executed, if you were to print the number 9.1234, you would see:
The example program demonstrates how a value is rounded. The first printing uses the default number of decimals, and the second shows how to control the number of decimals with setNumDecimals.
The example program uses the command printNewLine. It makes the printing skip to the next line, and that is explained further in a following printing tutorial.
Next tutorial: Printing text