From f63a9ac77d542ec7f630526934ce05d0e527de7a Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Thu, 27 Apr 2023 19:14:17 +0200 Subject: [PATCH 1/2] Print detected event. --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index 0f60f1d75..a438c24e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -64,6 +64,7 @@ void loop() const auto event = getEvent(); if (event) { + Serial.printf("Process event '%u'.\n", event); constexpr std::uint16_t notes[] = {note::c3, note::d3, note::e3, note::f3, note::g3, note::a3, note::b3, note::c4}; const std::uint8_t newRegisterValue = 1 << (8 - event); outputShiftRegister.setAll(&newRegisterValue); From 1b07d38fe0add7e16fe484888b5c64685fb9dde5 Mon Sep 17 00:00:00 2001 From: David Hebbeker Date: Thu, 27 Apr 2023 20:12:51 +0200 Subject: [PATCH 2/2] Miscellaneous cleanup. --- src/main.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a438c24e7..f5706d7b4 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,11 +2,9 @@ #include "board_pins.hpp" #include "display.h" #include "pitches.hpp" -//#include #include #include #include -#include #include /** @@ -14,11 +12,13 @@ */ ShiftRegister74HC595<1U> outputShiftRegister(board::osr::pin::data, board::osr::pin::clock, board::osr::pin::latch); +/** + * Input shift register. + */ Rox74HC165<1U> inputShiftRegister; /** - * - * @return 1-8 or 0 in case of no event + * @returns 1-8 or 0 in case of no event */ static std::uint8_t getEvent() { @@ -49,7 +49,6 @@ namespace main { void setup(char const *programIdentificationString) { - // put your setup code here, to run once: pinMode(board::buzzer::pin::on_off, OUTPUT); inputShiftRegister.begin(board::isr::pin::data, board::isr::pin::latch, board::isr::pin::clock); setup_display();