# Funky switch

<figure><img src="/files/NcH9rdbcUitQatJhxgjI" alt=""><figcaption></figcaption></figure>

Alps RKJXT1F42001, or just "funky switch". It has an encoder, covered under [funkyRotary](/ddc/switch-library/encoders/funkyrotary.md), 4 directional button presses and 1 center pushbutton.

<figure><img src="/files/93w2QdAcRrODOR68eXk7" alt=""><figcaption></figcaption></figure>

As you can see from the schematic above, no directional input (A,B,C,D) will find its way to common pin unless pushbutton also i pressed. This is how this switch works. The pushbutton is pressed together with every directional input. It serves as a pushbutton, but is also designed to prevent bouncing, by only closing the circuit to common when the switch is properly in place. This gives us a problem to solve however, since you can't tell if the center push button is pressed alone by only reading the value from that button. We'll need an algorithm that avoids producing a button press if the pushbutton is pressed together with a directional button press. That is why funky switches have their own pushbutton functions.&#x20;

There are different algorithms for the center push button and the directional buttons, so they are listed seperately. ***You'll need to use one function for each directional input, and one for the push. Five altogether.***&#x20;

When setting up a funky switch in 30\_Switches.ino, you should list the directinonal functions first, and the center push button function last:

<figure><img src="/files/dtK5FCP2SeWwe5nhSqtz" alt=""><figcaption><p><mark style="color:green;"><strong>Correct</strong></mark></p></figcaption></figure>

<figure><img src="/files/hSEB5bD8NwMTaIJf77dk" alt=""><figcaption><p><mark style="color:red;"><strong>Incorrect</strong></mark></p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dahl-design.gitbook.io/ddc/switch-library/funky-switch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
