Difference between revisions of "VEX2 Functions Display"

From ROBOTC API Guide
Jump to: navigation, search
 
(21 intermediate revisions by one user not shown)
Line 1: Line 1:
{| style="font-family:Verdana, Genega, sans-sarif; font-size:80%;color:gray;" width="100%" cellpadding="0%" cellspacing="0" border="0"
+
<yambe:breadcrumb self="Display">VEX2_Functions_and_Variables|Functions and Variables</yambe:breadcrumb>
|-
+
<br />
|
+
''[[Main_Page|Main]] >> [[VEX2_Main|CORTEX]] >> [[VEX2: Functions| Functions and Variables]] >> [[VEX2:_Functions_-_Display|Display]] ''
+
|-
+
|}
+
 
+
 
+
{| class="wikiText"
+
|-
+
|''For information about ROBOTC ''string'', please see the article: [[VEX2:_Functions_-_Strings|Strings]].''
+
|-
+
|}
+
 
+
  
 
{|
 
{|
 
|-
 
|-
|style="vertical-align:top"| __TOC__
+
|''For information about ROBOTC ''string'', please see the article: [[VEX2_Functions_Strings|Strings]].''
|style="vertical-align:top"|
+
{| width="100" cellpadding="2" cellspacing="0" style="border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000"
+
!colspan="2" class="wikiHeader"|Color Key
+
|-
+
|class="wikiText" width="75%" style="border-style: solid; border-width: 1px 0px 0px 0px"|Function:
+
|width="25%" style="border-style: solid; border-width: 1px 0px 0px 0px;" class="colorKeyFunc"|
+
|-
+
|class="wikiText" width="75%" style="border-style: solid; border-width: 0px 0px 0px 0px"|Variable:
+
|width="25%" style="border-style: solid; border-width: 0px 0px 0px 0px;" class="colorKeyVar"|
+
|}
+
 
|-
 
|-
|}
+
|
 
+
'''Some display functions offer a precision parameter, which pads the displayed number with either zeros or spaces, until the number of digits is equal to the precision value:'''
 
+
== Information ==
+
{|
+
|-
+
|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.
+
 
+
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:center; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000;" cellpadding="5%"
+
  ! style="border-style: solid; border-width: 0px 1px 1px 0px"|''Specifier''
+
  ! style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Output
+
  ! style="border-style: solid; border-width: 0px 1px 1px 0px"|Example Code
+
  ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Example Output
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%d or %i
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Signed decimal integer
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%d"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|4246
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%e
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Scientific notation (mantise/exponent) using e character
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%e"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|3.9265e+2
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%E
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Scientific notation (mantise/exponent) using E character
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%E"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|3.9265E+2
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%f
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Decimal floating point number
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%f"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|3.14159
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%o
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Signed octal
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%o"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|157
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%s
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|String of characters
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%s"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|ROBOTC
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%x
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Unsigned hexadecimal integer
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%x"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|7fa
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%X
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Unsigned hexadecimal integer (capital letters)
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|"%X"
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|7FA
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 0px 0px"|%c
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 0px 0px"|Character
+
  | style="border-style: solid; border-width: 0px 1px 0px 0px"|"%c"
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|b
+
  |-
+
  |}
+
 
+
 
+
'''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 <span class="keywordB">PI</span> '''(3.14159265)''', but you only want to dispay '''"3.14"''', your string should contain, <span class="codePunc">"%</span><span class="codeStringsNums">1.2f</span><span class="codePunc">"</span>. 
+
 
+
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 <span class="codePunc">"%</span><span class="codeStringsNums">1.2f</span><span class="codePunc">"</span> 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:'''
+
 
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:center; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000;" cellpadding="5%"
 
{| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:center; font-size:100%; border-collapse: separate; border-spacing: 0; border-width: 1px; border-style: solid; border-color: #000;" cellpadding="5%"
   ! style="border-style: solid; border-width: 0px 1px 1px 0px"|''Specifier''
+
   ! style="border-style: solid; border-width: 0px 1px 1px 0px"|''Precision value''
 
   ! style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Description
 
   ! style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Description
 
   ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Example Output
 
   ! style="border-style: solid; border-width: 0px 0px 1px 0px"|Example Output
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 1px 1px 0px"|%d
+
   | style="border-style: solid; border-width: 0px 1px 1px 0px"|-4
   | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Prints a decimial integer
+
   | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Pads the displayed number with zeros until the number of digits equals 4.
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|50
+
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|000# <br />00## <br />0### <br />####
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 1px 1px 0px"|%6d
+
   | style="border-style: solid; border-width: 0px 1px 1px 0px"|0
   | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Prints a decimal integer, at least 6 characters wide
+
   | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|No padding.
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|_ _ _ _ 50
+
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|##
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 1px 1px 0px"|%f
+
   | style="border-style: solid; border-width: 0px 1px 0px 0px"|4
   | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Prints a floating point number
+
   | style="text-align:left; border-style: solid; border-width: 0px 1px 0px 0px"|Pads the displayed number with spaces until the number of digits equals 4.  
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|50.5
+
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|_ _ _# <br />_ _## <br />_### <br />####
  |-
+
   | style="border-style: solid; border-width: 0px 1px 1px 0px"|%6f
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Prints a floating point number, at least 6 characters wide
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|_ _ _ 50.5
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 1px 0px"|%.2f
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 1px 0px"|Prints a floating point number, with at least 2 decimal places
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|50.50
+
  |-
+
  | style="border-style: solid; border-width: 0px 1px 0px 0px"|%6.2f
+
  | style="text-align:left; border-style: solid; border-width: 0px 1px 0px 0px"|Prints a floating point number, with at least 6 characters wide and 2 decimal places
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|__ 50.50
+
 
   |-
 
   |-
 
   |}
 
   |}
 
''Note: Underscore ( _ ) character denotes a space.''
 
''Note: Underscore ( _ ) character denotes a space.''
|-
 
|}
 
 
<br />
 
<br />
 
== bNxtLCDStatusDisplay ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
| class="variableType"| <span class="bigKeywordBI">bool </span><span class="bigKeywordB">bNxtLCDStatusDisplay</span>
 
|-
 
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_bool|bool]]) Boolean variable that indicates whether the top status line display on the LCD should be present on user-drawn LCD screens.
 
|-
 
|
 
  {|
 
  |-
 
  |<syntaxhighlight lang="ROBOTC">bNxtLCDStatusDisplay = true;  // the NXT top status line WILL display on user-drawn LCD screens
 
bNxtLCDStatusDisplay = false;  // the NXT top status line WILL NOT display on user-drawn LCD screens</syntaxhighlight>
 
  |-
 
  |}
 
 
|-
 
|-
 
|}
 
|}
 
<br />
 
<br />
  
== eraseDisplay ==
+
{{tl|1|1}}
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">eraseDisplay</span><span class="bigCodePunc">()</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases the complete NXT LCD display. 
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">eraseDisplay();  // erase the entire NXT LCD display</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
 
<br />
 
<br />
  
== nxtClearPixel ==
+
== clearLCDLine ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtClearPixel</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">clearLCDLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Clears a single pixel on the NXT LCD screen.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Clears the indicated line of the VEX LCD to blanks.
 
|-
 
|-
 
|
 
|
Line 183: Line 48:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to clear.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPos''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 196: Line 57:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">
+
   |<syntaxhighlight lang="ROBOTC">clearLCDLine(1);  //Clears the second line of the LCD Screen (0 would be the first line)</syntaxhighlight>
int X = 50;          // create and initialize variable 'X' = 50 
+
int Y = 32;          // create and initialize variable 'Y' = 32 
+
nxtClearPixel(X, Y);  // clear a pixel at position (X, Y)</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 206: Line 64:
 
<br />
 
<br />
  
== nxtDisplayBigStringAt ==
+
== displayLCDCenteredString ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayBigStringAt</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayLCDCenteredString</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sString</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Formats  a text string and displays it at any (X,Y) coordinate on the LCD display. Drawing uses a large font that is 16-pixels high.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Clears the indicated line of the VEX LCD to blanks.
 
|-
 
|-
 
|
 
|
Line 219: Line 77:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|X-coordinate of pixel to start text from
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to display on.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sString''  
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|Y-coordinate of pixel to start text from
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The string to display.
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 236: Line 90:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">
+
   |<syntaxhighlight lang="ROBOTC">displayLCDCenteredString(0,"ROBOT123");  //Displays the string "ROBOTC123" to the center of line 0</syntaxhighlight>
int printMe = 1;                                              // create and Initialize 'printMe' = 1
+
int printMeToo = 2;                                          // create and Initialize 'printMeToo' = 2
+
nxtDisplayBigStringAt(0, 31, "%d, %d", printMe, PrintMeToo);  // displays (in large font): "1, 2"  
+
                                                              // beginning at (0, 31)</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 247: Line 97:
 
<br />
 
<br />
  
== nxtDisplayBigTextLine ==
+
== displayLCDChar ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayBigTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayLCDChar</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">cChar</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string on one of the 8 possible text lines. Drawing uses a large font that is 16-pixels high.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Clears the indicated line of the VEX LCD to blanks.
 
|-
 
|-
 
|
 
|
Line 260: Line 110:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to display on.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPos''  
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The position on 'nLine' to display from.
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   |}
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''cChar''  
|-
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The char to display.  Can be an int or char.
|
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">
+
int printMe = 1;                                          // create and Initialize 'printMe' = 1
+
int printMeToo = 2;                                      // create and Initialize 'printMeToo' = 2
+
nxtDisplayBigTextLine(3, "%d, %d", printMe, PrintMeToo);  // displays on line 3 (large): "1, 2"</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtDisplayCenteredBigTextLine ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayCenteredBigTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string on one of the 8 possible text lines. The text is horiztonally centered on the LCD display. Drawing uses a large font that is 16-pixels high.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''  
+
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
+
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 309: Line 127:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">
+
   |<syntaxhighlight lang="ROBOTC">displayLCDChar(0,0,'C');  //Displays the character 'C' at the first position on the first line.</syntaxhighlight>
int printMe = 1;                                                  // create and Initialize 'printMe' = 1
+
int printMeToo = 2;                                              // create and Initialize 'printMeToo' = 2
+
nxtDisplayCenteredBigTextLine(3, "%d, %d", printMe, PrintMeToo);  // displays on line 3 (centered and large): "1, 2"</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 319: Line 134:
 
<br />
 
<br />
  
== nxtDisplayCenteredTextLine ==
+
== displayLCDNumber ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayCenteredTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayLCDNumber</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nValue</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPrecision</span><span class="bigCodePunc"> = -</span><span class="bigCodeStringsNums">1</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string on one of the 8 possible text lines. The text is horiztonally centered on the LCD display.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a number nValue on line nLine at position nPos.
 
|-
 
|-
 
|
 
|
Line 332: Line 147:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to display on.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPos''  
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The position on 'nLine' to display from.
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   |}
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nValue''
|-
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The number to display.
|
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">
+
int printMe = 1;                                              // create and Initialize 'printMe' = 1
+
int printMeToo = 2;                                            // create and Initialize 'printMeToo' = 2
+
nxtDisplayCenteredTextLine(3, "%d, %d", printMe, PrintMeToo);  // displays on line 3 (centered): "1, 2"</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtDisplayClearTextLine ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayClearTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases a line of text. <span class="codeBasic">nLineNumber</span> specifies one of the 8 possible text lines.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
   ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLineNumber''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPrecision''  
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The precision of the number.  -1 by default.
 
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
Line 377: Line 168:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">nxtDisplayClearTextLine(3);  // clears line 3</syntaxhighlight>
+
   |<syntaxhighlight lang="ROBOTC">displayLCDNumber(0,0,331);  // displays the number 331 at the first position on the first line</syntaxhighlight>
 
   |-
 
   |-
 
   |}
 
   |}
Line 384: Line 175:
 
<br />
 
<br />
  
== nxtDisplayRICFile ==
+
== displayLCDPos ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayRICFile</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nleft</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nBottom</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const string </span><span class="bigCodeBasic">sFileName</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayLCDPos</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPos</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Display a RIC (i.e. "ICON" or "Picture") file on the NXT display at the specified coordinates.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Sets the next display position on the VEX LCD.
 
|-
 
|-
 
|
 
|
Line 397: Line 188:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLeft''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to display on.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|''nRight''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPos''  
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The position on 'nLine' to display from.
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFileName''  
+
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 414: Line 201:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">
+
   |<syntaxhighlight lang="ROBOTC">displayLCDPos(0,0);  // sets the next character position to the first character on line 1</syntaxhighlight>
while(true)                                // infinite loop:
+
{
+
  nxtDisplayRICFile(0, 0, "faceclosed.ric");  // display the .ric file, "faceclosed.ric" at pos(x,y)
+
  wait1Msec(50);                              // wait 50 milliseconds (helps refresh rate of LCD screen)
+
}</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 426: Line 208:
 
<br />
 
<br />
  
== nxtDisplayString ==
+
== displayLCDString ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayString</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayLCDString</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sString</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Formats a character string according the the format specified in <span class="codeBasic">sFormatString</span> using parameters <span class="codeBasic">parm1</span>, <span class="codeBasic">parm2</span>, and <span class="codeBasic">parm3</span>. Display the result on text line <span class="codeBasic">nLineNumber</span>. The remainder of the line is not altered; so that if the result string is 8 characters only the first eight characters of the text line are updated. The contents of the remaining characters on the line are not changed.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a string sString on line nLine at position nPos.
 
|-
 
|-
 
|
 
|
Line 439: Line 221:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to display on.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPos''  
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The position on 'nLine' to display from.
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   |}
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sString''  
|-
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The string to display.
|
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">
+
while(true)                    // infinite loop:
+
{
+
  string s1 = "Theory";          // create the string named s1, "Theory"
+
  nxtDisplayString(3, "%s", s1);  // display the string, 's1' on line 3
+
  wait1Msec(50);                  // wait 50 milliseconds (helps refresh rate of LCD screen)
+
}</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtDisplayStringAt ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayStringAt</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a text string  at (X,Y) coordinate on the LCD display.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''  
+
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|X-coordinate of pixel to start text from
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|Y-coordinate of pixel to start text from
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
   | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 496: Line 239:
 
   |-
 
   |-
 
   |<syntaxhighlight lang="ROBOTC">
 
   |<syntaxhighlight lang="ROBOTC">
while(true)                          // infinite loop:
+
displayLCDString(0,0,"ROBOTC");  // displays the string "ROBOTC" starting from the first position  
{
+
                                // on the first line</syntaxhighlight>
  nxtDisplayStringAt(0, 0, "Theory");  // display the string, "Theory" at position (x, y)
+
  wait1Msec(50);                      // wait 50 milliseconds (helps refresh rate of LCD screen)
+
}</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 507: Line 247:
 
<br />
 
<br />
  
== nxtDisplayTextLine ==
+
== displayNextLCDChar ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDisplayTextLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLineNumber</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayNextLCDChar</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">cChar</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Formats  a text string and displays it on one of the 8 possible text lines. The remainder of the line is padded with blanks.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a specific character on the VEX LCD.
 
|-
 
|-
 
|
 
|
Line 520: Line 260:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''nLineNumber''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''cChar''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The line to print a string on<br />([top] 0 to 7 [bottom])
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The char to display.  Can be an int or char.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''sFormatString''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 534: Line 270:
 
   |-
 
   |-
 
   |<syntaxhighlight lang="ROBOTC">
 
   |<syntaxhighlight lang="ROBOTC">
while(true)                       // infinite loop:
+
displayLCDPos(1,5);       // sets the current LCD position to line 2, character 6
{
+
displayNextLCdChar('A');  // displays the character 'A' on line 2, character 6</syntaxhighlight>
  string s1 = "Theory";             // create the string named s1, "Theory"
+
  nxtDisplayTextLine(3, "%s", s1);  // display the string, 's1' on line 3
+
  wait1Msec(50);                    // wait 50 milliseconds (helps refresh rate of LCD screen)
+
}</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 546: Line 278:
 
<br />
 
<br />
  
== nxtDrawCircle ==
+
== displayNextLCDNumber ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawCircle</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Diameter</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayNextLCDNumber</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nValue</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPrecision</span><span class="bigCodePunc"> = </span><span class="bigCodeStringsNums">0x40</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws outline of the circle with the specified coordinates.  Note that the point (Left, Top) is where the upper-left corner of a square with side length equal to "Diameter" would be if it were positioned exactly on top of our circle.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a integer number on the VEX LCD.
[[File:drawCircle_2.jpg]]
+
 
|-
 
|-
 
|
 
|
Line 560: Line 291:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nValue''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The x-coordinate of the upper left corner of the square with side length equal to diameter of circle
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The number to display.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPrecision''  
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|The y-coordinate of the upper left corner of the square with side length equal to diameter of circle
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The precision of the number.  64 by default.
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Diameter''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The diameter of the circle
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 577: Line 304:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">nxtDrawCircle(20, 50, 25);  // display a circle; left border at 20, top border at 50, diameter of 25</syntaxhighlight>
+
   |<syntaxhighlight lang="ROBOTC">displayNextLCDNumber(2365);  // displays the number '2365' onto the LCD screen</syntaxhighlight>
 
   |-
 
   |-
 
   |}
 
   |}
Line 584: Line 311:
 
<br />
 
<br />
  
== nxtDrawEllipse ==
+
== displayNextLCDString ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawEllipse</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">displayNextLCDString</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sString</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws outline of the ellipse with the specified coordinates.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Displays a integer number on the VEX LCD.
 
|-
 
|-
 
|
 
|
Line 597: Line 324:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sString''  
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the ellipse
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The string to display.
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_string|string]]
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''  
+
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the ellipse
+
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 618: Line 333:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">
+
   |<syntaxhighlight lang="ROBOTC">displayNextLCDString("ROBOT123");  // displays the string of text ROBOTC123 onto the LCD</syntaxhighlight>
nxtDrawEllipse(20, 50, 60, 25);  // display an ellipse; left border at 20, top border at 50,
+
                                // right border at 60, bottom border at 25</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}
Line 627: Line 340:
 
<br />
 
<br />
  
== nxtDrawLine ==
+
== setLCDPosition ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPosTo</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPosTo</span><span class="bigCodePunc">)</span>
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">setLCDPosition</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nLine</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">nPos</span><span class="bigCodePunc">)</span>
 
|-
 
|-
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws a line between two points.
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Sets the next display position on the VEX LCD.
 
|-
 
|-
 
|
 
|
Line 640: Line 353:
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
 
   |-
 
   |-
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''  
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nLine''  
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|The X-coordinate of the first point
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The line to display on.  0 is the top, 1 is the bottom.
   | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPos''  
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The Y-coordinate of the first point
+
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|The position on 'nLine' to display from.
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''xPosTo''  
+
   | style="border-style: solid; border-width: 0px 0px 1px 0px"|The X-coordinate of the second point
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPosTo''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The Y-coordinate of the second point
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtDrawLine(20, 50, 60, 25);  // display a line between the points (20,50) and (60,25)</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtDrawRect ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtDrawRect</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Draws outline of the rectangle with the specified coordinates.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the rectangle
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtDrawRect(20, 50, 60, 25);  // display a rectangle; left border at 20, top border at 50,
+
                              // right border at 60, bottom border at 25</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtEraseEllipse ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtEraseEllipse</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases (i.e. clears all pixels) the ellipse with the specified coordinates.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the ellipse
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtEraseEllipse(20, 50, 60, 25);  // erases an ellipse; left border at 20, top border at 50,
+
                                  // right border at 60, bottom border at 25</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtEraseLine ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtEraseLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPosTo</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPosTo</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases (i.e. clears) the pixels for the line between the specified pair of points.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The X-coordinate of the first point
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The Y-coordinate of the first point
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''xPosTo''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The X-coordinate of the second point
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPosTo''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The Y-coordinate of the second point
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtEraseLine(20, 50, 60, 25);  // erase a line between the points (20,50) and (60,25)</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtEraseRect ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtEraseRect</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Erases (i.e. clears all pixels) the rectangle with the specified coordinates.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the rectangle
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtEraseRect(20, 50, 60, 25);  // erase a rectangle; left border at 20, top border at 50,
+
                              // right border at 60, bottom border at 25</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtFillEllipse ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtFillEllipse</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Fills (i.e. all pixels black) the ellipse with the specified coordinates.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the ellipse
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the ellipse
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">
+
nxtFillEllipse(20, 50, 60, 25);  // display a solid ellipse; left border at 20, top border at 50,
+
                                // right border at 60, bottom border at 25</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtFillRect ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtFillRect</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Left</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Top</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Right</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">Bottom</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Fills (i.e. all pixels black) the rectangle with the specified coordinates.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''Left''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The left-most point of the rectangle
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Top''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The top-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''Right''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The right-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''Bottom''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The bottom-most point of the rectangle
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtFillRect(20, 50, 60, 25);  // display a solid rectangle; left border at 20, top border at 50,
+
                              // right border at 60, bottom border at 25</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtInvertLine ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtInvertLine</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPosTo</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPosTo</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Inverts the pixels for the given line. This function is very useful for functions like drawing a "clock face", a "compass" or a gauge on the LCD screen when you want to "erase" the previous dial pointer and redraw it at a new position. If you use "invert line" for the original drawing and for the "erase" drawing the two calls will cancel each other out! And it work well if the line overdraws some existing pixels -- e.g. some text on the LCD.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|The X-coordinate of the first point
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''yPos''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The Y-coordinate of the first point
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|''xPosTo''
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|The X-coordinate of the second point
+
  | style="border-style: solid; border-width: 0px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPosTo''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|The Y-coordinate of the second point
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtInvertLine(20, 50, 60, 25);  // invert the pixels on the line from (20,50) to (60,25)</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtScrollText ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtScrollText</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">string </span><span class="bigCodeBasic">sFormatString</span><span class="bigCodePunc">, </span><span class="bigCodeBasic">...</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Shift the LCD image up one line. Thenit  formats  a text string and displays it on the bottom line of the LCD text screen.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|''sFormatString''
+
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|the string(s) to display<br />(can be formatted!)
+
 
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   | style="border-style: solid; border-width: 1px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
 
   |-
 
   |-
Line 983: Line 366:
 
   {|
 
   {|
 
   |-
 
   |-
   |<syntaxhighlight lang="ROBOTC">
+
   |<syntaxhighlight lang="ROBOTC">displayLCDPos(0,0);  //Sets the next character position to the first character on line 1</syntaxhighlight>
for(i=0; i<1000; ++i)            // for Loop from 0 to 999 incrimenting 'i' by 1 each time:
+
{
+
  nxtScrollText("Scroll #%d.", i);  // display "Scroll #i." (%d is replaced with variable 'i' at runtime)
+
  wait1Msec(250);                  // wait 520 milliseconds between each iteration of the For Loop
+
}</syntaxhighlight>
+
  |-
+
  |}
+
|-
+
|}
+
<br />
+
 
+
== nxtSetPixel ==
+
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
+
|-
+
| class="functionType"| <span class="bigKeywordBI">void </span><span class="bigKeywordB">nxtSetPixel</span><span class="bigCodePunc">(</span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">xPos</span><span class="bigCodePunc">, </span><span class="bigKeywordBI">const int </span><span class="bigCodeBasic">yPos</span><span class="bigCodePunc">)</span>
+
|-
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_void|void]]) Sets a single pixel on the NXT LCD screen.
+
|-
+
|
+
  {| class="parameterTable" cellpadding="5%" width="100%"
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Parameter
+
  ! width="60%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Explanation
+
  ! width="20%" style="border-style: solid; border-width: 0px 0px 1px 0px"|Data Type
+
  |-
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|''xPos''
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|X-coordinate of pixel
+
  | style="border-style: solid; border-width: 1px 0px 1px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|''yPos''
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|Y-coordinate of pixel
+
  | style="border-style: solid; border-width: 0px 0px 0px 0px"|[[Data_Types#dataType_int|int]]
+
  |-
+
  |}
+
|-
+
|
+
  {|
+
  |-
+
  |<syntaxhighlight lang="ROBOTC">nxtSetPixel(42, 46);  // "set" a pixel (make it black) at position (42,46)</syntaxhighlight>
+
 
   |-
 
   |-
 
   |}
 
   |}

Latest revision as of 16:07, 30 April 2012


For information about ROBOTC string, please see the article: Strings.

Some display functions offer a precision parameter, which pads the displayed number with either zeros or spaces, until the number of digits is equal to the precision value:

Precision value Description Example Output
-4 Pads the displayed number with zeros until the number of digits equals 4. 000#
00##
0###
####
0 No padding. ##
4 Pads the displayed number with spaces until the number of digits equals 4. _ _ _#
_ _##
_###
####

Note: Underscore ( _ ) character denotes a space.


Color Key
Function:
Variable:


clearLCDLine

void clearLCDLine(const int nLine)
(void) Clears the indicated line of the VEX LCD to blanks.
Parameter Explanation Data Type
nLine The line to clear. 0 is the top, 1 is the bottom. int
clearLCDLine(1);  //Clears the second line of the LCD Screen (0 would be the first line)


displayLCDCenteredString

void displayLCDCenteredString(const int nLine, string sString)
(void) Clears the indicated line of the VEX LCD to blanks.
Parameter Explanation Data Type
nLine The line to display on. 0 is the top, 1 is the bottom. int
sString The string to display. string
displayLCDCenteredString(0,"ROBOT123");  //Displays the string "ROBOTC123" to the center of line 0


displayLCDChar

void displayLCDChar(const int nLine, const int nPos, const int cChar)
(void) Clears the indicated line of the VEX LCD to blanks.
Parameter Explanation Data Type
nLine The line to display on. 0 is the top, 1 is the bottom. int
nPos The position on 'nLine' to display from. int
cChar The char to display. Can be an int or char. int
displayLCDChar(0,0,'C');  //Displays the character 'C' at the first position on the first line.


displayLCDNumber

void displayLCDNumber(const int nLine, const int nPos, const int nValue, const int nPrecision = -1)
(void) Displays a number nValue on line nLine at position nPos.
Parameter Explanation Data Type
nLine The line to display on. 0 is the top, 1 is the bottom. int
nPos The position on 'nLine' to display from. int
nValue The number to display. int
nPrecision The precision of the number. -1 by default. int
displayLCDNumber(0,0,331);  // displays the number 331 at the first position on the first line


displayLCDPos

void displayLCDPos(const int nLine, const int nPos)
(void) Sets the next display position on the VEX LCD.
Parameter Explanation Data Type
nLine The line to display on. 0 is the top, 1 is the bottom. int
nPos The position on 'nLine' to display from. int
displayLCDPos(0,0);  // sets the next character position to the first character on line 1


displayLCDString

void displayLCDString(const int nLine, const int nPos, string sString)
(void) Displays a string sString on line nLine at position nPos.
Parameter Explanation Data Type
nLine The line to display on. 0 is the top, 1 is the bottom. int
nPos The position on 'nLine' to display from. int
sString The string to display. string
displayLCDString(0,0,"ROBOTC");  // displays the string "ROBOTC" starting from the first position 
                                 // on the first line


displayNextLCDChar

void displayNextLCDChar(const int cChar)
(void) Displays a specific character on the VEX LCD.
Parameter Explanation Data Type
cChar The char to display. Can be an int or char. int
displayLCDPos(1,5);       // sets the current LCD position to line 2, character 6
displayNextLCdChar('A');  // displays the character 'A' on line 2, character 6


displayNextLCDNumber

void displayNextLCDNumber(const int nValue, const int nPrecision = 0x40)
(void) Displays a integer number on the VEX LCD.
Parameter Explanation Data Type
nValue The number to display. int
nPrecision The precision of the number. 64 by default. int
displayNextLCDNumber(2365);  // displays the number '2365' onto the LCD screen


displayNextLCDString

void displayNextLCDString(string sString)
(void) Displays a integer number on the VEX LCD.
Parameter Explanation Data Type
sString The string to display. string
displayNextLCDString("ROBOT123");  // displays the string of text ROBOTC123 onto the LCD


setLCDPosition

void setLCDPosition(const int nLine, const int nPos)
(void) Sets the next display position on the VEX LCD.
Parameter Explanation Data Type
nLine The line to display on. 0 is the top, 1 is the bottom. int
nPos The position on 'nLine' to display from. int
displayLCDPos(0,0);  //Sets the next character position to the first character on line 1