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) {
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 }
const char *const sSyntaxError
Definition: command.cpp:11
void ADC(const char *input)
Definition: adc.cpp:11
float voltage()
Definition: battery.cpp:33
void reply(const char *s)
Definition: command.cpp:15
Definition: backlight.h:6