john green
Member
I would like to be able to read approximately 30 positions of a rotating device but rather than using 30 individual inputs on a PIC device would like to convert these to a binary sequence which would therefore only require 5 inputs.
I can see the means to both detect and convert the positions to binary (probably using hall effect sensors and a little logic) but would appreciate some suggestions as to how best to deal with the resulting inputs.
I presume there will be a better way than writing code to question each possible permutation of the five inputs to find which of the 30 possible states is presently valid.
What I envisage is to get the binary to a decimal variable from which a simple calculation would be made by consideration of two other variables and using this result to output instruction to rotate to a new position.
Thanks
I can see the means to both detect and convert the positions to binary (probably using hall effect sensors and a little logic) but would appreciate some suggestions as to how best to deal with the resulting inputs.
I presume there will be a better way than writing code to question each possible permutation of the five inputs to find which of the 30 possible states is presently valid.
What I envisage is to get the binary to a decimal variable from which a simple calculation would be made by consideration of two other variables and using this result to output instruction to rotate to a new position.
Thanks