Vintage tv conversion

Hi guys,

I'm a newb when it comes to arduino.
Looking for someone to help me out.

I have a 12 position rotary switch that I want to send a SINGLE keypress without repeating when toggled between positions.

Position 1 on rotary switch =
Send keyboard button number 1 only once without repeat
Position 2 on rotary switch =
Send keyboard button number 2 only once without repeat
Back to position 1 on rotary switch =
Send keyboard button number 1 only once etc. etc.

Each pin on the rotary switch will connect to a different pin on the arduino

Basically, I need them to act like a momentary rotary dial.

Is this possible?

Does anyone have an example code that I can test?

I appreciate all advice and discussion and thanks in advance!

1 Like

Please, more details of the switch. Does it have only one wafer (set of contacts)? Is it make before break, or break before make, etc.

How about a photo, specification or link to either?

Hey there

Please see ebay link for info:

Why not use rotary encoder and send selected position value on encoder button push?

1 Like

Just trying to use materials that I have.

I'm convering an old vintage crt tv into a modern tv set with lcd and kodi as interface.

I want to convert the UHF / VHF channels dials into keystrokes that will input numpad keystrokes 1 to 9 that will change channels in kodi.

1 Like

gotcha!

I would not run 12 lines to the MCU. I would have the MCU drive a 1:n decoder with all the outputs connected to the contacts 1-12, and the common return to an input pin. That would be 5 pins in total. Or a shift register, total 3 pins.

The older CB radios had digital encoders built in to the switch - just a 4 pole N position switch with each pole wired to yield one bit. For example
pole 1 - 0,1,0,1
pole 2 - 1,1, 0, 0
...

For clues about how to detect and process key events, see the digital example sketches that ship with the IDE.

When the switch is moved from position to position, the space between positions means there is NO connection. Your coding must allow for that. Similar to "debounce" on a push button switch.
Paul

Do you have the switch yet? Probably, there are better switch configurations for this purpose...

Hi,

These "programmable" rotary switches come as "break before make" or "make before break".
You need to check.


In my experience that brand/type are "make before break" unless specified, so when you switch two adjacent poles will be connected as the switch is rotated from one position to the next.

Tom... :grinning: :+1: :coffee: :australia:

Hi,
One solution is the 12position switch to select the function and a single press button to activate it.

If you don't want to use 12 I/O pins, have the rotary switch address a diode matrix that output 0 or 1 to 11 or 12 in binary. Thats 4 bits, 4 I/O.

Just my 20cents worth....Tom.... :grinning: :+1: :coffee: :australia:

I think I might connect 11x 1K resistors to the switch and use an analog input to detect the position. Effectively you are turning the switch into a pot, but one with only 12 positions. You might be able to solder the resistors directly to the back of the switch, with only 5V (3.3V?), GND and a wire to the analog pin going back to the Arduino.

Bingo! We have a winner!

I was going to suggest a priority encoder IC, but it only has 9 inputs.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.