Go to Post Our team has one goal: be ourselves. - PayneTrain [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
  #6   Spotlight this post!  
Unread 12-02-2008, 21:27
usbcd36's Avatar
usbcd36 usbcd36 is offline
Registered User
AKA: "DOS"
FRC #2399 (The Fighting Unicorns)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Solon, OH
Posts: 151
usbcd36 is a jewel in the roughusbcd36 is a jewel in the roughusbcd36 is a jewel in the rough
Re: pwm controlled by relay

You could use static variables to achieve these means.

Code:
static unsigned char Tank_Drive = 1; //default is tank drive

if (p1_sw_trig) Tank_Drive = 1; // enable tank drive
else if (p1_sw_aux1) Tank_Drive = 0; // enable other drive system

if(Tank_Drive)
{
     // code for tank drive here
}
else
{
     // code for other drive system here
}
What this will do is switch to tank drive when you press the trigger and switch to another drive system when you press the aux button. Not when you hold them down, but when you press them.

Last edited by usbcd36 : 12-02-2008 at 21:30.
 


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
Silicon Controlled Rectifier teh_pwnerer795 Electrical 37 26-11-2007 07:09
Guage of PWM/Relay Cables Jake M Electrical 2 07-02-2007 00:49
PC Controlled Robot EHaskins Programming 6 05-11-2006 06:45
Servos controlled by RC? Obi Programming 5 01-02-2005 14:43
relay and pwm outputs nick_champ_2 Electrical 1 31-01-2003 13:08


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

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