Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Servo ros_lib_kinetic
power.h
00001 /*-------------------------------------------------------------------------------- 00002 Filename: power.h 00003 Description: Header file for monitoring battery voltages 00004 --------------------------------------------------------------------------------*/ 00005 00006 #include "mbed.h" 00007 00008 #ifndef POWER_H 00009 #define POWER_H 00010 00011 /*-------------------------------------------------------------------------------- 00012 ---------------------------------DEFINES------------------------------------------ 00013 --------------------------------------------------------------------------------*/ 00014 #define VBATT PB_1 00015 #define V5 PC_2 00016 #define V3 PF_4 00017 00018 /*-------------------------------------------------------------------------------- 00019 ---------------------------------CLASSES------------------------------------------ 00020 --------------------------------------------------------------------------------*/ 00021 00022 class cPower 00023 { 00024 public: 00025 cPower(AnalogIn vbatt, AnalogIn fiveVolts, AnalogIn threeVolts); //Constructor, initialises the 4 input sensors 00026 float monitor_battery(); 00027 float monitor_5v_line(); 00028 float monitor_3v3_line(); 00029 private: 00030 AnalogIn _vbatt; 00031 AnalogIn _5v0; 00032 AnalogIn _3v3; 00033 }; 00034 00035 /*-------------------------------------------------------------------------------- 00036 -----------------------------------Functions--------------------------------------- 00037 --------------------------------------------------------------------------------*/ 00038 00039 /*-------------------------------------------------------------------------------- 00040 --------------------------------External Variables-------------------------------- 00041 --------------------------------------------------------------------------------*/ 00042 00043 #endif
Generated on Wed Jul 13 2022 08:03:55 by
1.7.2