My given 2 examples seems similar ;but one is <AFMotor.h> ( V1 Adafruit motor shield library ) v1 coding a little different that the V2 version of Adafruit motor shield library. I gave both ;because both of them don't work while I rotate the potentiometer.
I put your reformatted version of my code, it still doesn't work. I don't know where I do wrong really.I have written somewhere missing at my coding or written wrongly , I cannot able to understand. There is no problem with my potentiometer because I can rotate the servo motor with it from that adafruit motor shield ;and I was written a simple movement code for dc motor solo and it works too. However, when I put a potentiometer it doesn't work at all :-(.
I have checked google about how to fix this issue or is there any examples ;but there is nothing really. There are only " dc motor + encoder " or " stepper motor + encoder/potentiometer " examples ;but there is no " dc motor + potentiometer " example for adafruit motor shield. Thus, I cannot figure out where I miss or where I do wrong. I don't have an encoder or stepper motor in my inventory ;so would you/anyone help me please to solve this issue ?
Please give me some tips/clues ;or a small example of coding for this issue. I am trying for hours how to solve this issue but I cannot fix it. Friends, I am really stuck at my tank project now ( at " dc motor + pot " coding at adafruit v1 or v2 motor shield " ). Please help me, I look forward your replies to me here, thank you very much.
Not :
AF_DCMotor left1stMotor(1);
I was assigned " left1stMotor " as my left bottom motor at my tank project. There will be 4 motors at body.
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.
//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.