Hi folks, can any one help with a problem I just can't get my head around.
What i am trying to do is read 2 adc pins and compare them, if the voltage on both is within 20% then loop to main prog but if one is more than 20% above the other then switch a motor on
The motor should turn c/w or cc/w dependent upon which adc reading is higher.
Any ideas PLEASE.
Sorry I forgot to say I need some way of avioding rollover or under for the variables so that the motor drive dose not go in the wrong direction.
This is my first atempt at writing a program for any thing but if I can get this working then I have loads of ideas for projects so please help out an "old fart".
What i am trying to do is read 2 adc pins and compare them, if the voltage on both is within 20% then loop to main prog but if one is more than 20% above the other then switch a motor on
The motor should turn c/w or cc/w dependent upon which adc reading is higher.
Any ideas PLEASE.
Sorry I forgot to say I need some way of avioding rollover or under for the variables so that the motor drive dose not go in the wrong direction.
This is my first atempt at writing a program for any thing but if I can get this working then I have loads of ideas for projects so please help out an "old fart".
Last edited: