Go to Post When our arm "spontaneously combusted in the middle of the field", your team was the first to offer assistance to help fix it. - KTorak [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Spotlight this post!  
Unread 09-04-2006, 20:26
kiettyyyy's Avatar
kiettyyyy kiettyyyy is offline
Registered User
FRC #1538 (The Holy Cows)
Team Role: Engineer
 
Join Date: Mar 2006
Rookie Year: 2005
Location: San Diego, CA
Posts: 181
kiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond reputekiettyyyy has a reputation beyond repute
Send a message via AIM to kiettyyyy
Re: Camera without servos

So you mean something like this?

Code:
if (swt_camera)
{
	if (pan_error < 5 | pan_error > -5)
	{
		// Set drive motors to neutral
		pwm_rightDrive_cim = pwm_rightDrive_cim = 127;
		pwm_leftDrive_cim = pwm_leftDrive_fp = 127;

		// Tell the controller that it is now on target 
		Tracking_State += STATE_PAN_ON_TARGET;
	}
	else
	{
		// If the image is not center, check with the allowable error range
		if (pan_error > PAN_ALLOWABLE_ERROR_DEFAULT)
		{
			// Attempt to turn left
			pwm_rightDrive_cim = pwm_rightDrive_cim = 200;
			pwm_leftDrive_cim = pwm_leftDrive_fp = 120;
		}
		else if(pan_error < -1 * PAN_ALLOWABLE_ERROR_DEFAULT)
		{
			// Attempt to turn right
			pwm_rightDrive_cim = pwm_rightDrive_cim = 120;
			pwm_leftDrive_cim = pwm_leftDrive_fp = 200;
		}
		else
		{
			// Set drive motors to neutral
			pwm_rightDrive_cim = pwm_rightDrive_cim = 127;
			pwm_leftDrive_cim = pwm_leftDrive_fp = 127;

			// Tell the controller that it is now on target 
			Tracking_State += STATE_PAN_ON_TARGET;
		}
	}
}
Sorry I can't really format it inside this little form :-/

Thanks for the help!
__________________
-Kiet Chau

2004-2008 - Software Developer/Driver on Team #968
2008-2011 - Software Developer/Coach/Mentor/"Engineer" on Team #968
2011-Present - Mentor & Engineer on Team #1538
www.team1538.com

Last edited by kiettyyyy : 09-04-2006 at 21:01.
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Camera shows no love to drive motors anifinder Programming 4 13-02-2006 10:31
How To Use the Google Camera generalbrando Kit & Additional Hardware 2 07-02-2006 16:00
Servos controlling camera and purple screen ryan_f Programming 6 17-01-2006 23:21
servos and the camera incognito_NICK Programming 5 09-02-2005 00:00
Servos for the camera MV_Hirsch Programming 4 24-01-2005 16:35


All times are GMT -5. The time now is 21:13.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi