I might be misreading your tone, but the sense I get from the multiple ellipses is that you think my request to see your entire program is overly demanding. Is this the case? What you did in this thread is like saying “my board doesn’t work” and posting a picture of your setup that shows you’re not applying power. Then, when someone points out that your power problem, you reply that you are powering your board in your “real setup”, thereby casting doubt on the validity of your entire initial “fake setup” photo. Asking someone to spend a lot of time thoroughly debugging an approximation of your program that clearly won’t work is quite lame.
At any rate, thank you for posting your full program. I don’t see anything off-hand that could explain your issues, but I think this could be a good learning experience for you on troubleshooting. The key is simplification. You have a lot of different things going on that should be completely independent of your problem, so you should start by stripping them out of your program, at which point one of two things will happen:
- Your program will start working and you will have found the source of your problem.
- You’ll have a program that doesn’t work but is only a few lines long. It will be much easier for others to help you figure out the problem when presented with such a short, simple program.
As a first step, I suggest you remove all of your set_motor() calls and take out the completely unnecessary lcd_scroll() calls. I’m envisioning something like:
while (1)
{
if (turn_val < 1)
{
clear();
print("turn 1");
delay_ms(1000);
turn_val++;
}
else if (turn_val < 2)
{
clear();
print("turn 1");
delay_ms(1000);
turn_val++;
}
else ...
If it still doesn’t work, please post the simplified version of your program and I’ll take a look at it. Get to the point where you can have turn_val increment as you expect and then start adding back the extra stuff like motors and LCD scrolling.
- Ben
