PID tuned for 2S battery

This commit is contained in:
2023-03-20 20:59:23 -03:00
parent 7e69147bc4
commit d37e9c5aea
12 changed files with 275 additions and 65 deletions

View File

@@ -0,0 +1,27 @@
/*
* Encoder.hpp
*
* Created on: Mar 17, 2023
* Author: Gabriel
*/
#ifndef SRC_COMPONENTS_ENCODER_HPP_
#define SRC_COMPONENTS_ENCODER_HPP_
#include "main.h"
class Encoder {
public:
Encoder(__IO uint32_t* cnt, __IO uint32_t* arr, uint32_t countsPerRevolution);
virtual ~Encoder();
uint32_t getCount();
int16_t getDelta();
uint32_t getCountsPerRevolution();
private:
__IO uint32_t* cnt;
__IO uint32_t* arr;
uint32_t lastCount = 0;
uint32_t countsPerRevolution = 0;
};
#endif /* SRC_COMPONENTS_ENCODER_HPP_ */