25 std::array<uint8_t, 7> cathode;
26 std::vector<uint8_t> anode;
27 std::array<uint8_t, 10> format;
43 SegmentsLed(std::array<uint8_t, 7>&& cathode,
44 std::vector<uint8_t>&& anode,
45 std::array<uint8_t, 10>&& format = {
58 , anode(
std::move(anode))
66 for (
auto&& pin : cathode)
70 for (
auto&& pin : anode)
78 void setValue(
int num)
87 const uint8_t single =
static_cast<uint8_t
>(value / pow(10, digit)) % 10;
90 digitalWrite(anode.at(digit), HIGH);
93 if (digit >= anode.size())
98 for (uint8_t i = 0; i < cathode.size(); i++)
100 digitalWrite(cathode.at(i), not bitRead(format.at(single), i));
104 digitalWrite(anode.at(digit), LOW);
109 for (
auto&& pin : anode)
111 digitalWrite(pin, HIGH);
115 for (
int i = 0; i < 6; ++i)
117 digitalWrite(cathode.at(i), HIGH);
119 digitalWrite(cathode.at(6), LOW);
Definition Typedef.hpp:94