cewkomator/firmware/src/number_input.h

22 lines
586 B
C

#pragma once
#define NUMBER_INPUT_BACK -1
/**
* Uses second row of the screen, keyboard, and encoder to get a number from the user.
*
* Number cannot be longer than 8 characters, or less than 0.
*
* If defaultValue is -1, it will default to empty string.
* defaultValue will be truncated to at most 3 decimal places.
*
* It will return the number when it's confirmed by encoder press or [C]ontinue.
* It will return NUMBER_INPUT_BACK if [B]ack is pressed.
*
* LCD is set to .noCursor() before returning.
*/
float number_input(
float defaultValue,
float encoderStep
);