23 lines
450 B
C++
23 lines
450 B
C++
#ifndef KEYBOARD_CLASS
|
|
#define KEYBOARD_CLASS
|
|
#include "PCF8574.h"
|
|
#include <bits/stdc++.h>
|
|
class Keyboard
|
|
{
|
|
private:
|
|
unsigned long timeElapsed;
|
|
std::queue<char> buffer;
|
|
uint8_t debounce;
|
|
PCF8574* pcf8574;
|
|
int lastKey;
|
|
/* data */
|
|
public:
|
|
Keyboard(uint8_t debounce);
|
|
~Keyboard();
|
|
void scan();
|
|
void begin(TwoWire *databus);
|
|
static char getChr(uint8_t key);
|
|
char getChr();
|
|
bool available();
|
|
};
|
|
#endif |