Go to Post "John V-Neun - The Thing / Ken Patton - Mr. Fantastic" I don't think a better description of these two people have ever been posted on ChiefDelphi. - Amanda Morrison [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
  #9   Spotlight this post!  
Unread 14-02-2007, 13:06
Ianuser Ianuser is offline
Registered User
FRC #0570
 
Join Date: Feb 2007
Location: new york
Posts: 64
Ianuser is an unknown quantity at this point
Re: Where do I begin to get the robot to move using the camera?

Thanks. I made these changes, hopefully it will work:

At the top of user_Routines.c I declared this
Code:
int pwm03_On_Off = 1;
Then in the Default_Routine() where I map to the joysticks I put this
Code:
if(pwm03_On_Off == 1)
  {
	pwm03 = p3_y; //ForkLift
  }
An example of my switch-case statements (for a metal sensor that increments the 'count' variable each time it passes...and there each time it passes certain things happen in the CASE...) is this
Code:
if((pwm03 < 125) || (pwm03 > 129))  //if py_3 is being used (forklift going up or down)
 	{
		if((now == 1) && (last == 0)) //If sensor, which connects to Dig In/Out port 4, sends a signal...
		{
			count++; //Number of times tape passes through the sensor.
			Switch1_LED = 1; //Switch01 goes on when the tape passes the sensor.
		}
		else
		{
			Switch1_LED = 0;
		}

		switch(count) //for sensor module
		{
			case 1:			//if count = 1 then that just means that it passed through the first piece of tape which will be used to show that it is in full DOWN position.

				Relay2_green = 1;
				Relay2_red = 0;
				printf("count = 1");
				break;

			case 2:
		
				Relay2_green = 1;
				Relay2_red = 0;
				pwm03 != p3_y;
				pwm03_On_Off = 0;
				pwm03 = 127; //Motor stops when it reaches 1st level of rack.
				printf("count = 2");
				break;
There are more cases, but those are the basic formats of the others anyway. Basically for case 2: I want to have he motor pwm03 stop and the joystick not mapped to pwm03 anymore. I have this in my code that allows me to reset the counter and to remap pwm03 to the joystick (so we can move it again):
This is all still in Default_Routine()
Code:
             last = now;
	now = rc_dig_in04;

	last2 = now2;
	now2 = p3_sw_trig;

	last3 = now3;
	now3 = p3_sw_aux1;

//some other stuff, but then:

if((now3 == 1) && (last3 == 0)) //p3_sw_aux1 sets counter to 0 in case forklift needs to be reset.
	{
		count = 0;
	}


	if((now2 == 1) && (last2 == 0)) //p3_sw_trig sets joystick 3 y-axis to forklift motor. Use after each level.
	{
		pwm03_On_Off = 1;
	}
So, think this will work? there is a snowday at my school today and they wont let us in to work on the robot, so I have to wait another day before I can test any of this. Thanks
 


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
Building the field :: where can I get the carpet? Armando Gonzalez Technical Discussion 10 12-01-2007 14:14
Where in the world is the new 2007 cmu camera docs?!?!? xrabohrok Programming 13 08-01-2007 20:28
Where do we get more extention wires for the Vex robot? pbrules15 Technical Discussion 5 27-01-2006 07:48
how do u figure out the torque req'd to move a robot? Salik Syed Technical Discussion 11 03-11-2004 08:12
Using Robotics to get the girl necroprime Chit-Chat 66 21-03-2003 23:21


All times are GMT -5. The time now is 06:16.

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