Hey
I am on a project Using a continuous pot on a Roll forming roller to know the length of the work piece , I need a code to read the value even it exceeds the limit (which will be done every complete revolution)
Keep a secondary counter for revolutions, reset it if a counter had not changed after x ticks of the pot not moving?
timer = timer + 1;
if(revolution = max_revolution) {
revolutions = revolutions + 1;
}
length = (revolutions * max revolution) + revolution - prev_revolution;
if(revolution == past_revolution && timer >= x) {
revolutions = 0;
prev_revolution = revolution;
}
MohamedArafat:
I need a code
It's your job to write the code. If you run into problems we will try to help.
If you want to use a continuous potentiometer to count revolutions then just increment your count every time the value from analogRead() changes from a high value to a low value or vice versa if it is turning in the other direction.
If you want someone to write a program for you please ask in the Gigs and Collaborations section of the Forum and be prepared to pay.
...R