LCD Shield Question

I made some changes to my stepper speeds in my code that reads 0-30 rpm on my LCD Shield that was reading fine before the changes. Now when I turn the potentiometer to zero, the stepper stops but the display will read a number (usually less than 2 and sometimes 0.37) that is not zero. But if I turn the pot back and forth sometimes it will read zero. What would likely be the cause?? The pot turns the motor off (or at least down to zero rpms) so I don't think it is the pot. Thanks

Get ahead of the curve and post your code. Format the code with T in the IDE to align indents.

arduino code posting.PNG

arduino code posting.PNG

It works fine with my code. Make your code like mine. If you think that's hard to do without being able to see my code, then imagine trying to debug something that doesn't work that you can't see.

Delta_G: It works fine with my code. Make your code like mine. If you think that's hard to do without being able to see my code, then imagine trying to debug something that doesn't work that you can't see.

I like that response. OP probably won't, but he/she will need to get over it.

I am already over it. ;D The problem I have is that I purchased these plans and the pdf says copyright do not copy etc. So in order to be honest, I am not supposed to copy and post the code. If somebody would be kind enough to allow me to PM them the code, I would rather do that. Or, seeing that I modified the existing code, is it alright to post it? I don't know. All I know is the author says you are on your own if you mod the code. What should I do?? Thanks

If somebody would be kind enough to allow me to PM them the code, I would rather do that.

You can PM me. I may decide that you should post it here.

PaulS: You can PM me. I may decide that you should post it here.

Thank you. I will send it now. If you decide it can be posted please remove anything not needed to solve this problem.

The pot turns the motor off (or at least down to zero rpms) so I don't think it is the pot.

Perhaps you should measure the voltage on the wiper with your multi-meter.

It might be that the pot isn't on 0V, the code is interpreting that as a non-0 RPM, but the value is too low to actually move the motor which makes you think the motor's commanded to 0 RPM.

That, in the absence of your code and a schematic, is a wag though.

kenwood120s: Perhaps you should measure the voltage on the wiper with your multi-meter.

It might be that the pot isn't on 0V, the code is interpreting that as a non-0 RPM, but the value is too low to actually move the motor which makes you think the motor's commanded to 0 RPM.

That, in the absence of your code and a schematic, is a wag though.

Good idea. Thanks. I PM'ed the code so we will see what happens on that. The code as written had a few issues the way the steps were set and the p/rev causing noises and vibrations at low speeds. So I changed the code as shown below:

const int stepsPerRevolution = 1600;

to

const int stepsPerRevolution = 200;

and 

int motorSpeed = map(sensorReading, 0, 1023, 0, 120);

to

int motorSpeed = map(sensorReading, 0, 1023, 0, 960);

and

lcd.print(float(float(motorSpeed)/float(12)),1);

to

lcd.print(float(float(motorSpeed)/float(32)),1);