The `taiko-io-mini/` directory contains the project for a single taiko, generally used for a single taiko environment. The project is designed using LCEDA.
This hardware project includes 4 channels of analog input and 4 buttons, must use test point to configuration, and USB power supply.
The `TK_usb_CH552_mini/` directory contains software adapted for the single taiko hardware, capable of being enumerated as different USB devices, such as USB-HID keyboard or n******o switch compatible gamepad.
The software projects for the sampling microcontroller are located in this directory. The software uses macros to differentiate between two hardware models.
The software is compiled using Keil 5, and relevant software functionality can be enabled/disabled based on macros before compilation, allowing for switching between hardware versions.
- Input Frequency Limitation: Both the ns platform games and ニジイロ have input frequency limitations. After testing, each player has independent limitations. For the same player, a single channel can have a maximum limit of 30 inputs per second, while all four channels together are limited to 60 inputs per second. Inputs exceeding this frequency will be discarded.
This means that if only left or right taiko hits are played, a maximum of 30 hits per second can be achieved. However, if left and right taiko hits are alternated, it can be increased to 60 hits per second.
- Hardware Limitations of the ns Platform: Key inputs have a long debouncing time, and both pressing and releasing the keys need to be held for a certain period to take effect.
Within an ns game, this period needs to be greater than 20ms. However, on the home screen, it needs to be much greater than 20ms, even up to 100ms, which may be due to variable filtering time supported by the ns.
- Data Injection for ニジイロ:
## Cross-Channel Output Allocation
The implementation of this feature is located in the [USB microcontroller](./USB-MCU/).
Due to different device capabilities or software running methods, different software support different maximum input frequencies. The purpose of allocating the output channels is to achieve the input frequency limit of the particular device.
The behavior observed is that when the triggering frequency is high, inputs from the same channel will be allocated to another channel. Different devices adopt different approaches:
- ns: Aggressive debouncing is performed, and when there are high-frequency inputs, they are allocated primarily to the two adjacent keys on the same side.
- ニジイロ: The game software limits the maximum global input frequency and the maximum input frequency for a single channel. This may be for the convenience of calculating images. Here, the input frequency for a single channel is limited, and inputs of the same type (e.g., "dong") are allocated to idle channels.
- Other applications on PC (such as Open Taiko): These software programs do not have input frequency limitations, so no allocation is needed.
Taiko sensors are fixed on several relatively independent wooden boards. In general, direct strikes on the boards produce signals with much higher intensity compared to signals affected by vibration or crosstalk.
The approach here is to introduce a small delay after the first trigger and wait for other channels to trigger. If multiple channels are triggered during this period, the channel with the strongest signal is output.
If crosstalk occurs no matter how it is adjusted, the taiko's structure needs to be considered. Check if any sensors have come loose or if the height adjustment of the wooden boards is appropriate.