Go to Post This will be one of the nerdiest weekends in the history of the world. And I'm taking part in it! (yay!) - Dan Petrovic [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
  #8   Spotlight this post!  
Unread 11-02-2007, 01:46
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: How do I program this sensor?

Code:
	switch(count)
		{
			case 2:
		
				Relay2_green = 1;
				Relay2_red = 0;
				pwm03 = 127; //Motor stops when it reaches 1st level.
				break;
			
			case 3:
			
				Relay2_green = 1;
				Relay2_red = 0;
				pwm03 = 127; //Motor stops when it reaches 2nd level.
				break;

			case 4:
					
				Relay2_green = 1;
				Relay2_red = 1;
				pwm03 = 127; //Motor stops when it reaches top level.
				break;

			case 5:

				Relay2_green = 0;
				Relay2_red = 1;
				//pwm03 does not equal 127 because it must pass the tape in order to go beneath the top level.
				break;

			case 6:
			
				Relay2_green = 0;
				Relay2_red = 1;
				pwm03 = 127; //Motor stops when it retreats to 2nd level.
				break;
			
			case 7:
			
				Relay2_green = 0;
				Relay2_red = 1;
				pwm03 = 127; //Motor stops when it retreats to 1st level.
				break;

			case 8:
			
				Relay2_green = 0;
				Relay2_red = 0;
				pwm03 = 127; //Motor stops when it retreats to ground level.
				count = 0;
				break;

		//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.
		}
Aight, so this is my switch.
Now, if I try to do the forwards/backwards thing, I wont have the correct relay lights, but I guess that would be ok. We could do without that. Also, I had a feeling that I would have a problem with the joysticks and setting the pwm value to 127. Could I use a timer? We'll see, thats another step for another day. THANKS AGAIN SO MUCH!!!
 


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
Vex line follower sensor kit program jbill30 Programming 5 12-05-2006 14:43
What's happening to this program??? Weightmn General Forum 22 04-04-2005 15:40
TI Pressure Sensor this year? kmcclary Pneumatics 1 20-01-2005 20:53
This board is quiet-- so how bout this election?!?!? archiver 2000 19 24-06-2002 00:23
How do you connect optical sensor? archiver 2001 1 23-06-2002 23:05


All times are GMT -5. The time now is 00:20.

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