Difference between revisions of "VEX2 Battery and Power Control"

From ROBOTC API Guide
Jump to: navigation, search
(BackupBatteryLevel)
 
(4 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="Battery and Power Control">VEX2_Functions_and_Variables|Functions and Variables</yambe:breadcrumb>
 +
<br />
 +
 
 +
{{tl|1|1}}
 +
<br />
 +
 
 +
== BackupBatteryLevel ==
 +
{| style="color:black;" width="100%" cellpadding="5%" cellspacing="0" border="0"
 
|-
 
|-
|  
+
| class="variableType"|<span class="bigKeywordBI">word </span><span class="bigKeywordB">BackupBatteryLevel</span>
''[[Main_Page|Main]] &rarr; [[VEX2_Main|CORTEX]] &rarr; [[VEX2: Functions| Functions and Variables]] &rarr; [[VEX2:_Functions_-_Battery_and_Power_Control|Battery and Power Control]] ''
+
 
|-
 
|-
|}
+
| style="font-family:Verdana, Geneva, sans-serif; color:black; background-color:#FFFFFF; text-align:left; font-size:100%;"|([[Data_Types#dataType_word|word]])  The power level in millivolts of the backup battery. (A value of 9458 represent 9.458 volts.)
 
+
{| class="wikiText"
+
 
|-
 
|-
 
|
 
|
 +
  {|
 +
  |-
 +
  |<syntaxhighlight lang="ROBOTC">
 +
int backupLevel = BackupBatteryLevel;  // create and set integer variable 'backupLevel'
 +
                                      // to the backup battery's power level</syntaxhighlight>
 +
  |-
 +
  |}
 
|-
 
|-
 
|}
 
|}
 
+
<br />
 
+
{|
+
|-
+
|style="vertical-align:top"| __TOC__
+
|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"|
+
|}
+
|-
+
|}
+
 
+
  
 
== nAvgBatteryLevel ==
 
== nAvgBatteryLevel ==

Latest revision as of 16:08, 18 May 2012

CORTEXFunctions and Variables → Battery and Power Control


Color Key
Function:
Variable:


BackupBatteryLevel

word BackupBatteryLevel
(word) The power level in millivolts of the backup battery. (A value of 9458 represent 9.458 volts.)
int backupLevel = BackupBatteryLevel;  // create and set integer variable 'backupLevel' 
                                       // to the backup battery's power level


nAvgBatteryLevel

int nAvgBatteryLevel
(int) The average battery level in millivolts. (A value of 9458 represent 9.458 volts.) It's the average of 20 recent samples and smoothes out sudden voltage transients.
int nBatteryAverage = nAvgBatteryLevel;  // create and set integer variable 'nBatteryAverage' 
                                         // to the average batter level of the device


nImmediateBatteryLevel

int nImmediateBatteryLevel
(int) The last sampled battery level in millivolts. (A value of 9458 represent 9.458 volts.)
int nBatteryLevel = nImmediateBatteryLevel;  // create and set integer variable 'nBatteryLevel'
                                             // to the immediate battery level