Numworks Epsilon
1.4.1
Graphing Calculator Operating System
adc.cpp
Go to the documentation of this file.
1
#include "
command.h
"
2
#include <
ion.h
>
3
#include <
poincare.h
>
4
#include <
ion/src/device/led.h
>
5
6
namespace
Ion
{
7
namespace
Device {
8
namespace
Bench {
9
namespace
Command
{
10
11
void
ADC
(
const
char
* input) {
12
if
(input !=
nullptr
) {
13
reply
(
sSyntaxError
);
14
return
;
15
}
16
float
result =
Ion::Battery::voltage
();
17
constexpr
int
precision = 8;
18
constexpr
int
bufferSize = Poincare::PrintFloat::bufferSizeForFloatsWithPrecision(precision);
19
char
responseBuffer[bufferSize+4] = {
'A'
,
'D'
,
'C'
,
'='
};
// ADC=
20
Poincare::PrintFloat::convertFloatToText<float>(result, responseBuffer+4, bufferSize, precision);
21
reply
(responseBuffer);
22
}
23
24
}
25
}
26
}
27
}
command.h
poincare.h
ion.h
Ion::Device::Bench::Command::sSyntaxError
const char *const sSyntaxError
Definition:
command.cpp:11
Ion::Device::Bench::Command::ADC
void ADC(const char *input)
Definition:
adc.cpp:11
Ion::Display::Device::Command
Command
Definition:
display.h:63
led.h
Ion::Battery::voltage
float voltage()
Definition:
battery.cpp:33
Ion::Device::Bench::Command::reply
void reply(const char *s)
Definition:
command.cpp:15
Ion
Definition:
backlight.h:6
epsilon
ion
src
device
bench
command
adc.cpp
Generated by
1.8.14