Program multiple LEDs with Line Tracker - VexCodeProV5

  1. Format as code using ``` before and after.
  2. Use indents! I found a syntax error in your code just by adding the proper indents. Please look for it.
Code
#include “vex.h”

using namespace vex;

int main() {
   // Initializing Robot Configuration. DO NOT REMOVE!
  int threshold = 65;
  vexcodeInit();

  while (true) {

    waitUntil(LineTrackerC.value(pct) < threshold);
    LEDred.on();
    wait(2, sec);
    LEDred.off();

    waitUntil(LineTrackerD.value(pct) < threshold);
    LEDgreen.on();
    wait(2,sec);
    LEDgreen.off();

  }

}
}
  1. “It’s not working” does not help us help you. It doesn’t describe the problem in any way. We don’t know what errors to look for unless you give us some symtoms.
  2. The LEDs will alternate which one lights up, which I think you don’t want. You see, it says
while (true) {
  waitUntil(one < threshold);
  // Something
  waitUntil(two < threshold);
  // Something
}

That means after one is noticed, it will wait for the other one to be noticed.