add keyboard source code

This commit is contained in:
cuu
2023-06-14 13:46:28 +12:00
parent 5b69e9c831
commit 17269a8c72
24 changed files with 1850 additions and 0 deletions

View 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