Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Wiki Markup
Tietoja [värianturista|http://www.philohome.com/colcomp/cc.htm]

{code}
#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";      break;
      case GREENCOLOR:    sColor = "Green";     break;
      case YELLOWCOLOR:   sColor = "Yellow";    break;
      case REDCOLOR:      sColor = "Red";       break;
      case WHITECOLOR:    sColor = "White";     break;
      default:            sColor = "???";       break;
    }
    nxtDisplayCenteredTextLine(2, sColor);
    wait1Msec(50);
  }
}
{code}
Värianturin palauttamat arvot numeroina
|| Yellow || Grren || Red || White || Black || Blue ||
| 4 | 3 | 5 | 6 | 1 | 2 |