Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Code Block

\#pragma config(Sensor, S1,     colorPort,           sensorCOLORFULL)
//*\!\!Code automatically generated by 'ROBOTC' configuration wizard               \!\!*//

task main()
{
    string sColor;

    while (true)
   {
        switch (SensorValue\[colorPort\])
        {
             case BLACKCOLOR:    sColor = "Black";     break;
             case BLUECOLOR:     sColor = "Blue";&nbsp break;
     break;
            case GREENCOLOR:    sColor = "Green";     break;
             case YELLOWCOLOR:   sColor = "Yellow";    break;
             case REDCOLOR:      sColor = "Red";&nbsp break;
      break;
            case WHITECOLOR:    sColor = "White";     break;
      default:            default: sColor = "???";       break;
    }
   
        break;
     }
     nxtDisplayCenteredTextLine(2, sColor);
        wait1Msec(50);
   }
}