document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #include "qfixSoccerBoard.h"
  2.  
  3. #define SPEED1 150
  4.  
  5. SoccerBoard robot; // Klasse SoccerBoard initialisieren
  6.  
  7. int main()
  8. {
  9.     // Die LEDs sollen 10mal blinken
  10.     for(int i=0; i<10; i++)
  11.     {
  12.         robot.ledOff(0); // LED 0 und 1 einschalten
  13.         robot.ledOff(1);
  14.         sleep(1);
  15.         robot.ledOn(0); // LED 0 und 1 einschalten
  16.         robot.ledOn(1);
  17.         sleep(1);
  18.     }
  19.     robot.ledOff(0); // LED 0 und 1 einschalten
  20.     robot.ledOff(1);
  21.  
  22.     // Endlosschleife
  23.     while(1)
  24.     {
  25.         // Die Motoren drehen jeweils 2 s und stehen dann 2 s still
  26.         robot.motor(0, SPEED1);
  27.         robot.motor(1, SPEED1);
  28.         robot.motor(2, SPEED1);
  29.         robot.msleep(2000);
  30.         robot.motorsOff();
  31.         robot.msleep(2000);
  32.     }
  33. }
');