5 #include <util/delay.h>
12 static uint8_t _matrix0[MATRIX_ROWS];
13 static uint8_t _matrix1[MATRIX_ROWS];
15 static uint8_t read_col(void);
16 static void select_row(uint8_t row);
19 void matrix_init(void)
21 // Column: input w/pullup
25 // Row: Hi-Z(unselected)
36 for (int i=0; i < MATRIX_ROWS; i++) {
41 prev_matrix = _matrix1;
44 uint8_t matrix_scan(void)
53 for (row = 0; row < MATRIX_ROWS; row++) {
55 _delay_us(30); // without this wait read unstable value.
63 static uint8_t read_col(void)
68 static void select_row(uint8_t row)