Versions Compared

Key

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

...

Code Block
task main()
{
   while (1) // "ikuinen" silmukka
   {
      if (sensorValue[soundSensor] < 10) {
          motor[motorB] = 10;
                           motors[motorB] = motorsmotor[motorC] = 10;
      } else if (sensorValue[soundSensor] >= 10 && sensorValue[soundSensor] < 50) motors[motorB] = motors[motorC] = 50;{
      else    motor[motorB] = 50;
          motor[motorC] = 50;
      } else {
          motor[motorB] = 0;
                                motors[motorB] = motorsmotor[motorC] = 0;
   }
}