Hi, if you're willing to help me out, let me be more specific with my plan/idea :D.
Let say , my PWM input range is from 0.5ms to 1.5ms . so, i want to define 0.5ms as -100%, 1ms as 0% and 1.5ms as +100%, in ardunio.
I will have an another input from motor feedback from potentiometer, to detect the position of motor.
Let say, my feedback range is from 0 ohm to 10 ohm. so, i want to define 0ohm as -100%, 5ohm as 0% and 10 ohm as 100%, in ardunio.
After defining two inputs, i have the formula (Pwm input% - feedback% = result%).
I would like two have the final output as two bits.
If the result% is +ve, i want to have two bits output as bit1= 0 and bit2= 1.
If the result% is -ve, i want to have two bits output as bit1= 1 and bit2= 0.
Can you kindly help me with the programing for above case:D.
Your help is much appreciated.