4#include <AiEsp32RotaryEncoder.h>
9#define VERSION_2_HARDWARE
13int remap(
double x,
double oMin,
double oMax,
double nMin,
double nMax );
14int largest(
double arr[],
int n);
15void IRAM_ATTR button_down();
16void IRAM_ATTR button_up();
19void bound_byte(uint8_t * val,
int lower,
int upper);
void IRAM_ATTR buttonISR()
A debounced interrupt to set the button state.
Definition nanolux_util.cpp:165
int remap(double x, double oMin, double oMax, double nMin, double nMax)
Remaps a value in one range to another range.
Definition nanolux_util.cpp:88
long timer_overrun()
Returns the amount of time since expected loop termination.
Definition nanolux_util.cpp:271
int calculate_pattern_index()
Calculates the pattern index the rotary encoder currently corresponds to.
Definition nanolux_util.cpp:299
void begin_loop_timer(long ms)
Logs the current program loop start time and the expected loop end time.
Definition nanolux_util.cpp:256
void bound_byte(uint8_t *val, int lower, int upper)
Bounds a byte between an upper and a lower value.
Definition nanolux_util.cpp:71
void nanolux_serial_print(char *msg)
Prints a character array message if allowed to.
Definition nanolux_util.cpp:61
bool isEncoderButtonPressed()
Returns the current state of the rotary encoder button.
Definition nanolux_util.cpp:305
int largest(double arr[], int n)
Returns the index of the largest array element.
Definition nanolux_util.cpp:132
void IRAM_ATTR readEncoderISR()
Processes the interrupt for the rotary encoder on 2.0 hardware.
Definition nanolux_util.cpp:284
void setup_rotary_encoder()
Performs initial setup for the rotary encoder.
Definition nanolux_util.cpp:289
void reset_button_state()
Resets the button state to false.
Definition nanolux_util.cpp:156
void process_reset_button(int button_value)
If the hardware button is held for RESET_TIME, clear the list of saves and call led_on_forever().
Definition nanolux_util.cpp:215