![]() |
How to obtain battery voltage from within EasyC
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?
|
Re: How to obtain battery voltage from within EasyC
Quote:
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. |
Re: How to obtain battery voltage from within EasyC
Quote:
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. - |
| All times are GMT -5. The time now is 19:45. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi