Difference between revisions of "VEX2 Functions Display"

From ROBOTC API Guide
Jump to: navigation, search
Line 92: Line 92:
 
|}
 
|}
 
<br />
 
<br />
(const int nLine, const int nPos, const int cChar)
+
 
 
== displayLCDChar ==
 
== displayLCDChar ==
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
Line 124: Line 124:
 
   |-
 
   |-
 
   |<syntaxhighlight lang="ROBOTC">displayLCDChar(0,0,'C');  //Displays the character 'C' at the first position on the first line.</syntaxhighlight>
 
   |<syntaxhighlight lang="ROBOTC">displayLCDChar(0,0,'C');  //Displays the character 'C' at the first position on the first line.</syntaxhighlight>
 +
  |-
 +
  |}
 +
|-
 +
|}
 +
<br />
 +
 +
== displayLCDNumber ==
 +
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 +
|-
 +
| 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 number nValue on line nLine at position nPos.
 +
|-
 +
|
 +
  {| 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"|''nLine''
 +
  | 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 0px 0px"|[[Data_Types#dataType_int|int]]
 +
  |-
 +
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPos''
 +
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|The position on 'nLine' to display from.
 +
  | 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]]
 +
  |-
 +
  | style="border-style: solid; border-width: 1px 0px 0px 0px"|''nPrecision''
 +
  | 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]]
 +
  |-
 +
  |}
 +
|-
 +
|
 +
  {|
 +
  |-
 +
  |<syntaxhighlight lang="ROBOTC">displayLCDNumber(0,0,331);  // displays the number 331 at the first position on the first line</syntaxhighlight>
 
   |-
 
   |-
 
   |}
 
   |}

Revision as of 15:21, 13 February 2012

Main >> CORTEX >> Functions and Variables >> Display


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


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