with the tof code

Dependencies:   mbed Servo ros_lib_kinetic

Committer:
Stumi
Date:
Thu Nov 07 15:31:52 2019 +0000
Revision:
4:36a04230554d
Added power management class and obstacle avoidance

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Stumi 4:36a04230554d 1 /*--------------------------------------------------------------------------------
Stumi 4:36a04230554d 2 Filename: power.h
Stumi 4:36a04230554d 3 Description: Header file for monitoring battery voltages
Stumi 4:36a04230554d 4 --------------------------------------------------------------------------------*/
Stumi 4:36a04230554d 5
Stumi 4:36a04230554d 6 #include "mbed.h"
Stumi 4:36a04230554d 7
Stumi 4:36a04230554d 8 #ifndef POWER_H
Stumi 4:36a04230554d 9 #define POWER_H
Stumi 4:36a04230554d 10
Stumi 4:36a04230554d 11 /*--------------------------------------------------------------------------------
Stumi 4:36a04230554d 12 ---------------------------------DEFINES------------------------------------------
Stumi 4:36a04230554d 13 --------------------------------------------------------------------------------*/
Stumi 4:36a04230554d 14 #define VBATT PB_1
Stumi 4:36a04230554d 15 #define V5 PC_2
Stumi 4:36a04230554d 16 #define V3 PF_4
Stumi 4:36a04230554d 17
Stumi 4:36a04230554d 18 /*--------------------------------------------------------------------------------
Stumi 4:36a04230554d 19 ---------------------------------CLASSES------------------------------------------
Stumi 4:36a04230554d 20 --------------------------------------------------------------------------------*/
Stumi 4:36a04230554d 21
Stumi 4:36a04230554d 22 class cPower
Stumi 4:36a04230554d 23 {
Stumi 4:36a04230554d 24 public:
Stumi 4:36a04230554d 25 cPower(AnalogIn vbatt, AnalogIn fiveVolts, AnalogIn threeVolts); //Constructor, initialises the 4 input sensors
Stumi 4:36a04230554d 26 float monitor_battery();
Stumi 4:36a04230554d 27 float monitor_5v_line();
Stumi 4:36a04230554d 28 float monitor_3v3_line();
Stumi 4:36a04230554d 29 private:
Stumi 4:36a04230554d 30 AnalogIn _vbatt;
Stumi 4:36a04230554d 31 AnalogIn _5v0;
Stumi 4:36a04230554d 32 AnalogIn _3v3;
Stumi 4:36a04230554d 33 };
Stumi 4:36a04230554d 34
Stumi 4:36a04230554d 35 /*--------------------------------------------------------------------------------
Stumi 4:36a04230554d 36 -----------------------------------Functions---------------------------------------
Stumi 4:36a04230554d 37 --------------------------------------------------------------------------------*/
Stumi 4:36a04230554d 38
Stumi 4:36a04230554d 39 /*--------------------------------------------------------------------------------
Stumi 4:36a04230554d 40 --------------------------------External Variables--------------------------------
Stumi 4:36a04230554d 41 --------------------------------------------------------------------------------*/
Stumi 4:36a04230554d 42
Stumi 4:36a04230554d 43 #endif