Scaling input and output
Wanted to get some ideas on this before I decided which way I was going to go.
I have a variable serial input that is ranging from 0-480 in counts·and a serial·output of 0-24 inches.
It would be best thought as a 0-480 count moving a actuator 0-24 inches. If my decimal input is roughly 240 then my actuator needs to be at roughtly 12 inches or simply decimal 12 serial out.
I wanted some degree of accuracy but do not want to kill the speed. My thoughts were dividing the 480 by 24 inches and setting up 24 if/then statements. This would give me accuracy to 1 inch. I would like better resolution but don't want to kill the scan time either.
What are your thoughts?
I have a variable serial input that is ranging from 0-480 in counts·and a serial·output of 0-24 inches.
It would be best thought as a 0-480 count moving a actuator 0-24 inches. If my decimal input is roughly 240 then my actuator needs to be at roughtly 12 inches or simply decimal 12 serial out.
I wanted some degree of accuracy but do not want to kill the speed. My thoughts were dividing the 480 by 24 inches and setting up 24 if/then statements. This would give me accuracy to 1 inch. I would like better resolution but don't want to kill the scan time either.
What are your thoughts?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen