Musik-Tanz-Programm - der Quelltext

Der Quelltext


// Music file created by RCX Command Center.

#define __NOTETIME  10
#define __WAITTIME  12

void Melody1()
{
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(440,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(523,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(440,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(440,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(440,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(523,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(440,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(440,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(220,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,8**__NOTETIME); Wait(8**__WAITTIME);
  Wait(8**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(392,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(262,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(262,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(277,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(466,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(466,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(466,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(466,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(466,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(554,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(587,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(466,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(587,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(440,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(523,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(466,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(294,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(392,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(370,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(330,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(294,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(440,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(392,8**__NOTETIME); Wait(8**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(294,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(587,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(494,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(392,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(370,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(330,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(523,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(523,2**__NOTETIME); Wait(2**__WAITTIME);
  PlayTone(494,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(392,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(440,4**__NOTETIME); Wait(4**__WAITTIME);
  PlayTone(392,8**__NOTETIME); Wait(8**__WAITTIME);
}

void Run(int x){

    OnFwd(OUT_A + OUT_C);
    Wait(x);
}

void Turn(int y){
    Off(OUT_A);
    Wait(y);
   
}

void Stop(){

      Off(OUT_A);
      Off(OUT_C);
}

task main()
{

  SetSensor(SENSOR_1, SENSOR_LIGHT);
  SetPower(OUT_A, 1);
  SetPower(OUT_C, 1);
 
  while(true){
      if(SENSOR_1 > 60) {
        Stop();
        Melody1();
        ClearSensor(SENSOR_1);
      }
  Run(20);
  }
  //Turn(50);
  //Run(100);
  //Turn(70);
}
~

Autorin / Autor: Powderpuff Girls - Stand: 13. Juni 2001