VEX2 Battery and Power Control
From ROBOTC API Guide
(→BackupBatteryLevel) |
|||
| (2 intermediate revisions by one user not shown) | |||
| Line 2: | Line 2: | ||
<br /> | <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> |
| − | + | |- | |
| − | + | | 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.) | |
| − | + | |- | |
| − | + | | | |
| − | + | {| | |
| − | + | |- | |
| − | + | |<syntaxhighlight lang="ROBOTC"> | |
| − | + | int backupLevel = BackupBatteryLevel; // create and set integer variable 'backupLevel' | |
| − | + | // to the backup battery's power level</syntaxhighlight> | |
| − | + | |- | |
| + | |} | ||
|- | |- | ||
|} | |} | ||
| − | + | <br /> | |
== nAvgBatteryLevel == | == nAvgBatteryLevel == | ||
Latest revision as of 09:08, 18 May 2012
CORTEX → Functions and Variables → Battery and Power Control
|
| |||||||
BackupBatteryLevel
| word BackupBatteryLevel | |
| (word) The power level in millivolts of the backup battery. (A value of 9458 represent 9.458 volts.) | |
|
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. | |
|
nImmediateBatteryLevel
| int nImmediateBatteryLevel | |
| (int) The last sampled battery level in millivolts. (A value of 9458 represent 9.458 volts.) | |
|