AF_DCMotor left1stMotor(1);
I was assigned " left1stMotor " as my left bottom motor at my tank project. There will be 4 motors at body.
That does not explain what the 1 refers to.
Will the result ever be greater than 127 ?
I have 1K potentiomter ( but I will get 10K one soon ) ;so with this "potentiometerValue = potentiometerValue/4; " I wanted to make smaller the value for less pot rotation with my fingers.
If it is wired correctly it will not matter if the potentiometer is 1K or 10K, the value returned by analogRead() will still be between 0 and 1023. How is the potentiometer wired ?
//use this line or the next line but not both , what do you mean by " next line " ? it is the bottom line that is under the " potentiometerValue = map(potentiometerValue, 0, 1023, 0, 255); " ,right ? thanks.
The map function turns a range of values between 0 and 1023 into a range of values between 0 and 255. This effectively divides the original value by 4. Then your next line divides the value by 4 again so the maximum value will now be 64 and can never be greater than 127.
More generally, have you tried printing the value of any of the variables in your program to see if is doing what you expect ? Printing potentiometerValue just before you test it to see whether it is greater/less than 127 would be interesting.