23 lines
425 B
C++
23 lines
425 B
C++
// 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:
|
|
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
|