SPIKE-RT C++ API Reference
Loading...
Searching...
No Matches
Battery.h
1//
2// Battery.h
3//
4// Copyright (c) 2025 Embedded Technology Software Design Robot Contest
5//
6
7#ifndef SPIKE_CPP_API_BATTERY_H_
8#define SPIKE_CPP_API_BATTERY_H_
9
10#include <stdint.h>
11
12extern "C" {
13#include <spike/hub/battery.h>
14}
15
16namespace spikeapi {
21{
22public:
28 Battery(void) = default;
29
36 uint16_t getCurrent(void) const {
37 return hub_battery_get_current();
38 }
39
46 uint16_t getVoltage(void) const {
47 return hub_battery_get_voltage();
48 }
49
54 bool hasError() { return false; }
55
56
57}; // class Battery
58} // namespace spikeapi
59
60#endif // !SPIKE_CPP_API_BATTERY_H_
Battery(void)=default
uint16_t getVoltage(void) const
Definition Battery.h:46
bool hasError()
Definition Battery.h:54
uint16_t getCurrent(void) const
Definition Battery.h:36