View Single Post
  #3   Spotlight this post!  
Unread 14-02-2006, 00:05
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 750
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
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?

I think this is what you're going to need to do:

Go here:
http://users.wpi.edu/~bamiller/WPILib/Versions.html

Download this:
Version 060207

Unpack the .zip file and replace the copy of WPILIb.lib inside of the EasyC directory C:\Program Files\Intelitek\easyC for FRC\Frc\18F8722 with the copy of WPILib2k6.lib from the .zip file. (You'll need to rename WPILib2k6.lib to WPILIb.lib and over write the OLD "WPILIb.lib" file. Backup the old one FIRST. You need to do this for both 2005 controller and 2006 sub directories.

18F8722 = 2006 controller
18F8520 = 2005 controller

These two files need updated:
C:\Program Files\Intelitek\easyC for FRC\Frc\18F8722\WPILIb.lib
with
WPILib2k6.lib (rename this to WPILIb.lib, copy over the top of the old after backing it up)

and

C:\Program Files\Intelitek\easyC for FRC\Frc\18F8520\WPILIb.lib
with
WPILib2k5.lib (rename this to WPILIb.lib, copy over the top of the old after backing it up)


Start easyC

Make a USER CODE box or an ASSIGNMENT BOX, but you'll have to type it out, and put this in it:

myvariblebackupbattery = GetBackupBattery()
myvariblemainbattery = GetMainBattery()

There are two new functions to read the main and backup battery in 1/100ths of volt.

Good luck. Hopefully it will work for you.



-
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369