brickOS C++ v0.9.0
Battery.H
Go to the documentation of this file.
1
8// The contents of this file are subject to the Mozilla Public License
9// Version 1.0 (the "License"); you may not use this file except in
10// compliance with the License. You may obtain a copy of the License
11// at http://www.mozilla.org/MPL/
12//
13// Software distributed under the License is distributed on an "AS IS"
14// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15// the License for the specific language governing rights and
16// limitations under the License.
17//
18// This software was developed as part of the legOS project.
19//
20// Contributor: Pat Welch (legOS@mousebrains.com)
21
22#ifndef _Battery_H_
23#define _Battery_H_
24
25#include <config.h>
26#include <sys/battery.h>
27
28#if defined(CONF_DSENSOR)
38class Battery {
39public:
45 static int get() {return get_battery_mv();}
46};
47
48#else // CONF_DSENSOR
49#warning Enable CONF_DSENSOR to use Battery.H
50#endif // CONF_DSENSOR
51#endif // _Battery_H_
Battery-sensor interface (RCX Internal).
Definition Battery.H:38
static int get()
get the current battery strength value
Definition Battery.H:45