Go to Post I personally hope they change the terrain of the playing field ... if only to "level" the playing field. - Daniel_LaFleur [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
  #7   Spotlight this post!  
Unread 12-01-2008, 10:57
Vanquish Vanquish is offline
Registered User
no team
 
Join Date: Jan 2008
Rookie Year: 1980
Location: Somewhere
Posts: 19
Vanquish is an unknown quantity at this point
Re: SetPWM and our IR controls

I'm also new to programming and I am using 2007 default code. I have never done an autonomous before so any help would be appreciated.

Would something ilke this work?

Quote:
void User_Autonomous_Code(void)
{
/* Initialize all PWMs and Relays when entering Autonomous mode, or else it
will be stuck with the last values mapped from the joysticks. Remember,
even when Disabled it is reading inputs from the Operator Interface.
*/
pwm01 = pwm02 = pwm03 = pwm04 = pwm05 = pwm06 = pwm07 = pwm08 = 127;
pwm09 = pwm10 = pwm11 = pwm12 = pwm13 = pwm14 = pwm15 = pwm16 = 127;
relay1_fwd = relay1_rev = relay2_fwd = relay2_rev = 0;
relay3_fwd = relay3_rev = relay4_fwd = relay4_rev = 0;
relay5_fwd = relay5_rev = relay6_fwd = relay6_rev = 0;
relay7_fwd = relay7_rev = relay8_fwd = relay8_rev = 0;
digital_io_01 = digital_io_02 = digital_io_03 = digital_io_04 = INPUT;

while (autonomous_mode) /* DO NOT CHANGE! */
{
if (statusflag.NEW_SPI_DATA) /* 26.2ms loop area */
{
Getdata(&rxdata); /* DO NOT DELETE, or you will be stuck here forever! */

/* Add your own autonomous code here. */
if(digital_io_01==1)
{
SetPWM ( 1 , 65 );
SetPWM ( 2 , 192 );
}

Generate_Pwms(pwm13,pwm14,pwm15,pwm16);

Putdata(&txdata); /* DO NOT DELETE, or you will get no PWM outputs! */
}
}
}
 


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
help us program our controls dude_brd Programming 1 10-02-2007 12:02
need help on programing our controls dude_brd Programming 1 07-02-2007 18:42
FRC: Reset and Program Controls yanksrock777 General Forum 4 24-01-2007 22:37
Push Button and Switch Suppliers for OI controls Goldberg204 Control System 8 11-01-2007 15:27
pic: 383`s controls and driver Manoel Robot Showcase 13 03-03-2005 00:57


All times are GMT -5. The time now is 18:44.

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