Need some Help working the last bug out of my program
Hello, this summer have been working on making a robot out of my old RC car. It uses the PING))) sensor mounted on a servo to avoid objects. I have finally got everything working except for one little bug. I have the program setup so that one Cog handles scanning with the ping and then steers the wheels in the right direction. At the same time, another Cog checks the RPM of the drive wheels, then adjusts the output of a Pololu Micro Motor Controller to try and keep the RPM at a constant rate.
The Problem is, both of these routines don't work at the same time. I have narrowed it down to this, both routines need to call Simple Serial's Start and set the motor controller's reset pin High or they don't work. When the speed controlling cog first sends a command to the motor controller it dose not work and the scan/steering control cog's commands to the motor controller stop working too. Both of these routines work and do what I want them to when the other is removed from the program. I have attached the entire program and all of the associated objects. I know that my code may not be that well organized, but please take the time to look through it and let me know if you have any ideas. Feel free to ask for anymore information that might help you help me.
Thanks, Matthew
The Problem is, both of these routines don't work at the same time. I have narrowed it down to this, both routines need to call Simple Serial's Start and set the motor controller's reset pin High or they don't work. When the speed controlling cog first sends a command to the motor controller it dose not work and the scan/steering control cog's commands to the motor controller stop working too. Both of these routines work and do what I want them to when the other is removed from the program. I have attached the entire program and all of the associated objects. I know that my code may not be that well organized, but please take the time to look through it and let me know if you have any ideas. Feel free to ask for anymore information that might help you help me.
Thanks, Matthew
zip

19K
Comments
i..e in the Autospeed delete the serial.start and serial.tx, write MSpeed to a variable - Speed. Then in Main jut after the main repeat insert if Speed > 0 MC.Forward(Speed) else MC.Reverse(-Speed)
Dont forget to initial speed to 0
Matthew
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 9/4/2008 1:20:29 AM GMT