|
Re: gyro problem
Print out the pwm values to see if they correspond to what you are seeing or not. If so, your code is causing the pwm values to do weird things; if the pwm values are steady but the motors are doing weird things, that might point to a wiring problem.
Put printf's inside your conditionals (if(temp_gyro_angle <= -75)...) to see what is going on.
You are increasing/decreasing 'turn' based on gyro. What type is turn? char? int? Is it static?
If turn is a static char and you are increasing it by 15 38 times per second, it will overflow more than 2 times each second (15*38/256).
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
|