View Single Post
  #2   Spotlight this post!  
Unread 14-02-2006, 00:04
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 590
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: How to obtain battery voltage from within EasyC

Quote:
Originally Posted by DavidSJohnson
I read where battery level could be obtained using a define within ifi_aliases.h, but that header is not available within EasyC. Is there some way of getting battery level (and maybe backup battery level too) from within EasyC?
There are two functions recently added to WPILib (the runtime system for EasyC). These functions read the main and backup battery in 1/100ths of volt. The functions are:

unsigned GetBackupBattery(void) and

unsigned GetMainBattery(void)

You need to replace the copy of WPILib to get access to the functions. You also need to add the include file, "BuiltIns.h". The procedure is described elsewhere on this forum. Once you do that, then you can call these functions using User Code blocks.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute