Hi all
Im looking for examples on how to use the rotary switch but cant find any im after a 5 pin ive tried using the rotary switch 0-15 but cant work out how to use it as when configured as a 5 pin there are only 3 connections pin 1 pin 2 and pin 4 ?? thanks inadvance
Bob
Rotary switch
-
siliconchip
- Posts: 34
- http://meble-kuchenne.info.pl
- Joined: Wed Dec 16, 2020 10:38 am
- Has thanked: 16 times
- Been thanked: 1 time
-
chipfryer27
- Valued Contributor
- Posts: 2034
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 444 times
- Been thanked: 674 times
Re: Rotary switch
Hi
I haven't used that component and I see that there isn't an example yet.
However by clicking the number of positions in Properties it appears that it is giving a binary output dependent on the number of positions. So if you had only one position it uses VDD and one pin.
Two pins gives a value of up to three (01/10 / 11) positions etc
Four up to 15 positions
I'm sure you get the idea.
Regards
I haven't used that component and I see that there isn't an example yet.
However by clicking the number of positions in Properties it appears that it is giving a binary output dependent on the number of positions. So if you had only one position it uses VDD and one pin.
Two pins gives a value of up to three (01/10 / 11) positions etc
Four up to 15 positions
I'm sure you get the idea.
Regards
-
siliconchip
- Posts: 34
- Joined: Wed Dec 16, 2020 10:38 am
- Has thanked: 16 times
- Been thanked: 1 time
Re: Rotary switch
Hi chipfryer
I agree with that but im unsure where to put the binary code in relation to the switch
Bob
I agree with that but im unsure where to put the binary code in relation to the switch
Bob
-
chipfryer27
- Valued Contributor
- Posts: 2034
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 444 times
- Been thanked: 674 times
Re: Rotary switch
Hi
I see what you mean. A bit confusing.
I'll have a closer look later and get back to you.
Regards
I see what you mean. A bit confusing.
I'll have a closer look later and get back to you.
Regards
Re: Rotary switch
Hi,
It looks like this component is made for a BCD (Binary-Coded Decimal) thumbwheel switch (as shown in the attached picture), rather than a standard rotary switch with a common pin and individual position connections.
Unlike a standard selector switch, this unit outputs a 4-bit binary code (pins 1, 2, 4, and 8) corresponding to the selected digit (0–15).
It looks like this component is made for a BCD (Binary-Coded Decimal) thumbwheel switch (as shown in the attached picture), rather than a standard rotary switch with a common pin and individual position connections.
Unlike a standard selector switch, this unit outputs a 4-bit binary code (pins 1, 2, 4, and 8) corresponding to the selected digit (0–15).
- Attachments
-
- thumb wheel switch.jpg (16.7 KiB) Viewed 84 times
-
Steve-Matrix
- Matrix Staff
- Posts: 1985
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 296 times
- Been thanked: 459 times
Re: Rotary switch
Can someone post a specific part number or datasheet for what you are wanting (especially if it is commonly used and/or standard), and we'll have a look at creating one.
-
chipfryer27
- Valued Contributor
- Posts: 2034
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 444 times
- Been thanked: 674 times
Re: Rotary switch
Hi
As far as the component goes, attached is an example that hopefully explains it's operation. You mentioned five positions so that is what is being used,
In the chart I have a 3 x LED array connected to A0 - A2 and this will provide the binary output. The switch is connected to B0 - B2 (with VDD being a common).
There are two component macros, set position and get position.
Set position sets the value to whatever you want and in the example it sets it to "3".
In the loop it simply reads the current value of the switch (binary value) and displays on the LED array.
If you step through and in Simulation Debugger look at the variable Switch, you will see it reflecting the position.
Hope this helps.
As far as the component goes, attached is an example that hopefully explains it's operation. You mentioned five positions so that is what is being used,
In the chart I have a 3 x LED array connected to A0 - A2 and this will provide the binary output. The switch is connected to B0 - B2 (with VDD being a common).
There are two component macros, set position and get position.
Set position sets the value to whatever you want and in the example it sets it to "3".
In the loop it simply reads the current value of the switch (binary value) and displays on the LED array.
If you step through and in Simulation Debugger look at the variable Switch, you will see it reflecting the position.
Hope this helps.
- Attachments
-
- Rotary_Sw example.fcfx
- (12.38 KiB) Downloaded 26 times