SOFT564Z Group 3 / Mbed 2 deprecated SOFT564Z_Group_3v3

Dependencies:   mbed Servo ros_lib_kinetic

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers power.h Source File

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