2025-12-28 20:52:11 -06:00
|
|
|
#ifndef CALIBRATION_H
|
|
|
|
|
#define CALIBRATION_H
|
|
|
|
|
#include <atomic>
|
|
|
|
|
#include "encoder.hpp"
|
|
|
|
|
|
|
|
|
|
class Calibration {
|
|
|
|
|
public:
|
2026-01-04 11:43:23 -06:00
|
|
|
static void init();
|
|
|
|
|
static bool beginDownwardCalib(Encoder& topEnc);
|
|
|
|
|
static bool completeCalib(Encoder& topEnc);
|
|
|
|
|
static int32_t convertToTicks(uint8_t appPos);
|
|
|
|
|
static uint8_t convertToAppPos(int32_t ticks);
|
|
|
|
|
static bool getCalibrated() {return calibrated;}
|
|
|
|
|
static bool clearCalibrated();
|
|
|
|
|
static std::atomic<int32_t> DownTicks;
|
|
|
|
|
static std::atomic<int32_t> UpTicks;
|
2025-12-28 20:52:11 -06:00
|
|
|
|
|
|
|
|
private:
|
2026-01-04 11:43:23 -06:00
|
|
|
static std::atomic<bool> calibrated;
|
2025-12-28 20:52:11 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|