ROBOTC.net forums
http://www.robotc.net/forums/

macbook keyboard
http://www.robotc.net/forums/viewtopic.php?f=1&t=9609
Page 1 of 1

Author:  BurningLights [ Wed Oct 22, 2014 2:55 pm ]
Post subject:  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) {

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/