mirror of
https://github.com/clockworkpi/DevTerm.git
synced 2026-03-20 02:42:41 +01:00
borrwoed a lot code from https://github.com/foriequal0/devterm_keyboard in order to optimize the trackball
This commit is contained in:
29
Code/devterm_keyboard/glider.h
Normal file
29
Code/devterm_keyboard/glider.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef GLIDER_H
|
||||
#define GLIDER_H
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
class Glider {
|
||||
public:
|
||||
Glider();
|
||||
void setDirection(int8_t);
|
||||
void update(float velocity, uint16_t sustain);
|
||||
void updateSpeed(float velocity);
|
||||
void stop();
|
||||
|
||||
struct GlideResult {
|
||||
int8_t value;
|
||||
bool stopped;
|
||||
};
|
||||
GlideResult glide(uint8_t delta);
|
||||
|
||||
public:
|
||||
int8_t direction;
|
||||
float speed;
|
||||
uint16_t sustain;
|
||||
uint16_t release;
|
||||
float error;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user