View unanswered posts | View active topics It is currently Tue Dec 18, 2018 12:54 pm






Reply to topic  [ 1 post ] 
macbook keyboard 
Author Message
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: Need help
So, the problem is with your two lines that look like:
Code:
if (10 < vexRT[Ch2] < -10) {


While something like that is perfectly valid in mathematics, when programming in ROBOTC it is done like:
Code:
if (vexRT[Ch2] < -10 && vexRT[Ch2] > 10) {


I think you might also have your values mixed up, since something cannot be both less than -10 and greater than 10 at the same time. Perhaps you were trying for something more like this:
Code:
if (vexRT[Ch2] > -10 && vexRT[Ch2] < 10) {


Or, if you wanted to check for vexRT[Ch2] to be either less than 10 or greater than -10, that would look like:
Code:
if (vexRT[Ch2] < -10 || vexRT[Ch2] > 10) {

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Wed Oct 22, 2014 2:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.