document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. // Geeignete Kanäle der Fernbedienung
  2. // 0027 = Kanal 0
  3. // 0223 = Kanal 2
  4. // 0334 = Kanal 6
  5. // 0335 = Kanal 5
  6.  
  7. #include "qfixSoccerBoard.h"
  8. #include "LCD.h"
  9. #include "RC5.h"
  10. #include "qfixI2C.h"
  11. #include "qfixI2CDefs.h"    //Hier steht Adresse des LC-Displays
  12.  
  13. static const uint INVALID = 99; // Ungültiger Wert in rc5_data oder rc5_channel
  14. uint8_t my_rc5_channel=0;
  15.  
  16. SoccerBoard robot;          // Klasse SoccerBoard initialisieren
  17. LCD lcd;                    // Vererbung der LCD-Klasse
  18.  
  19. int main()
  20. {
  21.     Init_RC5();
  22.     lcd.init();
  23.     lcd.clear(); // LCD löschen
  24.     lcd.locate(1, 1);
  25.     lcd.print("Hallo äöü ÄÖÜ");
  26.     lcd.locate(2, 1);
  27.     lcd.print("Zweite Zeile");
  28.     sleep(4);
  29.     lcd.clear();
  30.    
  31.     rc5_data=INVALID;
  32.    
  33.     while(rc5_data==INVALID)
  34.     {
  35.         lcd.print("Taste drücken");
  36.         lcd.cursorhome();
  37.        
  38.     }
  39.     lcd.clear();
  40.     lcd.locate(2, 1);
  41.     lcd.print("Kanal:");
  42.     lcd.print_integer(rc5_channel);
  43.     sleep(4);
  44.    
  45.     my_rc5_channel=rc5_channel; // Ein Kanal wurde erkannt und reserviert
  46.     rc5_channel=INVALID; // Erstmal zurücksetzen...
  47.    
  48.     while(true)
  49.     {
  50.         if(my_rc5_channel == rc5_channel)
  51.         {
  52.             if(rc5_data != INVALID)
  53.             {
  54.                 switch(rc5_data)
  55.                 {
  56.                 case INVALID: break;
  57.                 case 42:
  58.                     lcd.locate(1, 1);
  59.                     lcd.print("vorwärts");
  60.                     break;
  61.                 case 11:
  62.                     lcd.locate(1, 1);
  63.                     lcd.print("links   ");
  64.                     break;
  65.                 case 10:
  66.                     lcd.locate(1, 1);
  67.                     lcd.print("rechts   ");
  68.                     break;
  69.                 case 43:
  70.                     lcd.locate(1, 1);
  71.                     lcd.print("stopp   ");
  72.                     break;
  73.                 }
  74.             }
  75.            
  76.             rc5_data=INVALID;
  77.         }
  78.     }
  79. }
');