arduino-joystick/Matrix.h

23 lines
425 B
C
Raw Normal View History

// A state-keeping class used with MatrixReader. Keeps track of which column is active,
// switches between them.
#ifndef _MATRIX_H_
#define _MATRIX_H_
#include <Arduino.h>
class Matrix {
public:
2021-11-24 05:40:28 +00:00
Matrix(uint8_t *columns, uint8_t num_columns, bool inverted=true);
void Activate(uint8_t column);
private:
void _enable(uint8_t pin);
void _disable(uint8_t pin);
uint8_t active_pin;
bool inverted;
};
#endif