Go to Post Right now, it drives around....hopefully tomorrow it will do a LOT more! - MrForbes [more]
Home
Go Back   Chief Delphi > Other > FIRST Tech Challenge
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 06-11-2009, 12:52
grampashades grampashades is offline
Registered User
FTC #0121
 
Join Date: Jan 2007
Rookie Year: 2004
Location: URI
Posts: 4
grampashades will become famous soon enough
Re: [FTC]: Robot C

Quote:
Originally Posted by jamie_1930 View Post
From what we've been doing the condition for your if statements should look like this

if(joy1Btn(1) == 1)
{
code here
}

this will make it so execute code when button 1 on joystick 1 is pressed.
First you guys want:

motor[motorE] = joystick.joy1_y2;

With C programming you set the thing on the left to the value on the right. The other way around shouldn't work. *Unless Robot C built it into the compiler to accept it both ways.

Also as a note to save you guys a lot of frustration later. I would suggets you put in a "dead zone" that stops you from powering the motors with too little voltage.


if ( ( joystick.joy1_y2 < -10) || ( joystick.joy1_y2 > 10))
{
motor[motorE] = joystick.joy1_y2;
}
else
{
motor[motorE] = 0;
}

your motors will thank you.

Second I've found throughout my tetsing that it is much better to program the buttons as such:


if(joy1Btn(1) )
{
code for what you want to happen here
}
else
{
code to make that stop happening
}

While there is not techinical difference in this case....for whatever reason the software gods seem to prefer it without the "==1"

finally, while techinically yes...you could put autonomous code into the "code here" section but you could also run into some serious problems...unless you keep all of your logic sound. You can easliy start getting in trouble when you try things like this.
Reply With Quote
 


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
[FTC]: Power Surge Robot Nitro-Guy FIRST Tech Challenge 7 21-05-2009 10:30
[FTC]: FTC Futures Forum at FTC World Championship gdo FIRST Tech Challenge 0 08-04-2009 18:46
[FTC]: FTC]: FTC Champ Tournament - Ontario (Scoring Breakdown) Mr. Lim FIRST Tech Challenge 2 03-03-2008 11:54
pic: FTC #3 robot design Techno-Turkey Extra Discussion 5 06-02-2008 08:07
[FTC]: [FTC]: Ontario Provincial FTC Start/End Times cbhl FIRST Tech Challenge 8 16-12-2007 13:37


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

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