11 #ifndef __CD4051_HEADER
12 #define __CD4051_HEADER
16 #include "../tool/out_pin.hpp"
17 #include "../tool/fake_button.hpp"
20 template<u
int8_t master, u
int8_t d0, u
int8_t d1, u
int8_t d2,
bool high_state = 0>
29 pinMode(master, INPUT_PULLUP);
31 pinMode(master, INPUT);
34 #define READ(x) in_[x].update(high_state == digitalRead(master));
56 void copy(T & vector, uint8_t
const & pos) {
57 for(uint8_t
i = 0;
i < 8; ++
i) {
58 vector[pos +
i] = in_[
i].state();
61 tool::fake_button_class
const &
operator[](uint8_t
const & pos)
const {
73 #endif //__CD4051_HEADER
Definition: CD4051.hpp:21
void copy(T &vector, uint8_t const &pos)
Definition: CD4051.hpp:56
tool::fake_button_class const & operator[](uint8_t const &pos) const
Definition: CD4051.hpp:61
void update()
Definition: CD4051.hpp:33
CD4051_class()
Definition: CD4051.hpp:23