text: #pragma config(Sensor, in4,    pot,            sensorPotentiometer)
  #pragma config(Sensor, dgtl1,  quad,           sensorQuadEncoder)
  #pragma config(Sensor, dgtl3,  limit,          sensorTouch)
  #pragma config(Sensor, dgtl4,  bump,           sensorTouch)
  #pragma config(Sensor, dgtl5,  ledGreen,       sensorLEDtoVCC)
  #pragma config(Sensor, dgtl6,  ledYellow,      sensorLEDtoVCC)
  #pragma config(Sensor, dgtl7,  ledRed,         sensorLEDtoVCC)
  #pragma config(Sensor, dgtl8,  jumpper,        sensorTouch)
  #pragma config(Sensor, dgtl11, ultransonic,    sensorSONAR_inch)
  #pragma config(Motor,  port2,           drive,         tmotorVex393_MC29, openLoop)
  //*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
  
  task main()
  {
  while (1)
      {
          float i = SensorValue[pot];
          float x = 127*i;
          float y = x/4096;
          motor[drive] = y;
  
          if(y/127< .45)
          {
              SensorValue[ledRed] = 1;
          }
          else if (.45 < y/127 <= .9)
          {
              SensorValue[ledYellow] = 1;
          }
          else if (y/127 > .9)
          {
              SensorValue[ledGreen] = 1;
          }
      }
  /* I turned ther pot val into a decemal (percent) in oreder to make the motor run at the same percent power.
   That is the reason for having 2 var, 'i' and 'x', i being the pot val and a being the percent*/
  
  }
  