View Single Post
  #3   Spotlight this post!  
Unread 17-02-2007, 11:58
Oumonkey's Avatar
Oumonkey Oumonkey is offline
Master of the If statement
AKA: Josh Tyus
FRC #1555 (Pulse)
Team Role: Programmer
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Monon, IN
Posts: 50
Oumonkey has a spectacular aura aboutOumonkey has a spectacular aura about
Re: CMUcam communications with motors

Well, I guess that didn't make much sense. Oh well.
I have the camera working perfectly. But I have a few problems with it communicating with the rest of the robot. I'm not sure if this would be the right place for this or not. But if I can avoid making a new thread, yay....

The robot, besides the camera, is not responding at all. I hooked up the dashboard and all pwms are 0 and pwm08, which isnt used, is 255. pwm04 to pwm 09 are not used also, but they are still 0. I am not sure if this is something electrical or not. The code I added is below. I am unable to test the code on any other robot right now. The battery is still giving power, the backup battery is still working. I haven't changed any other code besides user_rouintes.c and user_routines_fast.c. Right now i am thinking it is electrical, but I don't know.
Another thing I would like to ask is if the code below would work the way I want it to. It should be set so, if the cameras pan servo is more than 10 degrees it goes right and vice versa.

EDIT: I have just tested it again, I used a clean CMUcam s_21 and I put to lines of pwm16 = 140; and pwm15 = 114; And nothing still happens.

Thanks
Josh
1555

This code isn not copied and pasted from the original, so I may have miss typed something.
Code:
if ((((int)PAN_SERVO - 124) * 65)/124 > 10)
{
pwm16 = 140;
pwm15 = 114;
}
else if ((((int)PAN_SERVO - 124) * 65)/124 < -10)
{
pwm16 = 114;
pwm15 = 140;
}
else
{
pwm16 = 127;
pwm15 = 127;
}
__________________

Last edited by Oumonkey : 17-02-2007 at 12:28.