My robot is following a line but is going incredibly slow. I realize that since I am using stepper motors this will be the case most of the time but in autonomous mode my bot can go pretty fast. I believe the problem with line following mode is my algorithm. Does anyone see anything in my function that I could possibly change to make it better? I am using interrupts on my line sensor. Also my motor functions being called are just stepping through the motor...
I understand I was just making it clear to everyone. I tried using interrupts on them and cant seem to get the timing right because I loose half of the torque.
Just looked at your code. My god you should learn how to program if you want to make anything half decent. It is one of the worst examples of copy and past coading I have ever seen.
Sorry to be brutal but this is more than half your problem.
I actually built the motor drivers myself but I don't have the schematic on this computer, I will post them later. I am an engineering student not a computer scientist. I am trying my best. My torque is not halfed.
Thanks Nick,
What do you think the best way to do this is? My past only consists of programming in languages like Assembly mostly. I have played around with a lot of Java but never for anything like this. I wrote the motor code like I would have in Assembly. I am not sure how I could do this without a delay. If I took out the delay I would blow a fuse because 12 V would be fed in directly. Any ideas?
I might have misunderstood what you were saying. I cannot have all of the motor coils active at the same time. Do you have an example of how I might do the motor code without the delays?
I tried the library and I had some trouble with it. There must be a way to do it without using the library. And yes, if I energized all of the coils of the motors too fast or at the same time I would blow my 2 amp fuse. That is why there are delays as well as why I am setting the motor wires low when they must be low. If the delays are below 4 mS, the motors have no torque and the bot will not move. Anything above 4 will move the bot though. I am experimenting with other methods of doing it right now, let me know if any of you find a way.
I tried the library and I had some trouble with it
What kind of trouble?
I don't know - Mr Wentworth just told me to come in here and say that there was trouble at the mill, that's all - I didn't expect a kind of Spanish Inquisition.