That would definitely work, and there's no problem with that, but you would need to have two identical
else {} blocks (one on each of the two if statements) so that the "move on to next bucket" code would be run if either of the conditions was false.
An easier way to do this is to use the "and" operator to combine both if statements. In ROBOTC, you write this as &&
Code:
task main()
{
if (conditional1(sensor)==2 && conditional2(sensor) > 100)
{
//run bucket commands
}
else
{
//move on to next bucket
}
}
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor