So, we have to make a robot car that can move a human. It needs to carry 80 kilo's, so we have quite big motors. It controls itself by following a line. I only have the following problem...
I made the code in two parts, first the part of the polulu qtr-8rc, That callibrated and read the line perfectly, then i made the part that controls the motors, also that worked perfectly. Now i put the two together, and my serial monitor flips out. It only reads maximum value's while calibrating, and then only displays zero's. Sometimes a string of weird characters appear also. The motors stop turning and start tweaking in all directions. Then it just stops until i reset the arduino again.
I used two very high current motors. (out of two cheap drills) They pull about 18 ampere's together when starting up, and around 15 when on a steady speed. We power the motors with two 12V battery's connected in parallel. (for high amp pulling capabilities.) They did work on these batteries before I put the program together. Im using a motorshield with 8 amp continous and 15 amp max.
Program included.
Hope someone can help me out! Its for my exams. (If you dont understand a part please notify me, i'm dutch, so some of the program is too.)
@MarkT Thank you! It works for some part. It does switch between state's but as soon as i connect both motors, it flips out. Without the motors it works fine. The program switches perfectly between states, but as soon as the motor are connected it flips out.