#Using BCD rotary switch
1 messages · Page 1 of 1 (latest)
It may help if you post a link to this rotary switch, so everyone can know what you mean.
Its a classical BCD
Below you can find what it looks like and the coding it use.
1 wire on C pin then 4 wires on 1 2 3 4
With the position of the switch, the outputs pin send a binary code
For 3 first position I can use pins 1 2 3 but for the 4th position no.
I was wondering if in MF we can do something like "I1 and I2 and not I3" to set an input
I guess you can connect C to GND and 1 2 4 8 to arduino pins
OK but how MF will know BCD code?
read each pin as a button, assign the button to a MF variable
with same value
1 2 4 8
And so where can I make à boolean condition to set an input?
now you create one output config that adds all the MF variables
and based on the result, you trigger a different position input
I would guess you skip the 0 value since there is no signal generated in that position.
oh, the button config needs to use the on release to assign 0 back to the variable
I think in that case, 0 value can then be used also.
Woah. This is very interesting concept. Since the binaries are unique code in their own wiring. We can treat them as a matrix while still wiring them all to gnd 😮
the switch position number corresponds 1:1 with the added binary value of the pins 1 2 4 8
not sure what you mean by treating them as a matrix
To make things a bit less complicated, you can do the MF variables addition in one output called say SwitchPos, then create another set of outputs, one for each switch position. Bring in the SwitchPos value as a config reference and do a transform based on the value of SwitchPos
Variables are set in output section, right?
For example the Transform for the third position (counting from 0) would be
if(#=2,1,0)
Normally you set them from input section, but they can be set on both sides.
The pin inputs are what you would use to set the MFvariables
I didn't find in input section but nevermind...I am right now designing the panel and the PCB. The principal is to know its possible. I will puzzle my mind when the panel will be finished
Thx again jaime
I don't recommend you design panel first. You should be breadboarding this first
I have never used this rotary switch, and this is just a concept right now. Untested.
OK OK i will test first. Thx