Hallo Manf,

Ja, dann gib sie doch mal an, es wäre doch interessant wenn sie vergleichen könnte.
Hier ist sie:
Code:
//------- Messwerte der IR-Distanz-Mess-Sensoren (C-Control II) --------
// Typ: SHARP GP2Y0A02YK,
// Minimale Messdistanz: 12 cm, Maximale Messdistanz: 150 cm.
// Achtung: Bei sehr kurzen Distanzen (< 12 cm) werden die Ausgabewerte
// des Sensors wieder KLEINER, so dass ein Messwert, der einer Distanz von
// z.B. 30 cm entspricht, auch bei einer Distanz von ca. 5 cm anliegt!
// Entfernungsangaben in [cm] ab Vorderkante der CCRP5-Hauptplatine.

const IRTABL[]= //Linker IR-Sensor:
// 0     1     2     3     4     5     6     7     8     9     Digital:
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //   0..   9
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  10..  19
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  20..  29
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  30..  39
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  40..  49
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  50..  59
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  60..  69
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  70..  79
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  80..  89
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //  90..  99
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 100.. 109
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 110.. 119
   0,    0,    0,  150,  147,  144,  142,  140,  138,  136, // 120.. 129
 134,  132,  130,  128,  126,  124,  122,  120,  118,  116, // 130.. 139
 115,  114,  113,  112,  111,  110,  109,  108,  106,  104, // 140.. 149
 102,  100,  100,   99,   99,   98,   98,   98,   97,   97, // 150.. 159
  97,   96,   96,   96,   95,   95,   94,   94,   93,   93, // 160.. 169
  92,   91,   90,   90,   89,   89,   88,   88,   87,   87, // 170.. 179
  86,   86,   85,   85,   84,   84,   83,   83,   82,   82, // 180.. 189
  81,   81,   80,   80,   79,   79,   78,   78,   77,   77, // 190.. 199
  76,   76,   75,   75,   74,   74,   74,   73,   73,   73, // 200.. 209
  72,   72,   72,   71,   71,   71,   70,   70,   70,   69, // 210.. 219
  69,   69,   68,   68,   68,   67,   67,   67,   66,   66, // 220.. 229
  66,   65,   65,   65,   65,   64,   64,   64,   64,   63, // 230.. 239
  63,   63,   63,   62,   62,   62,   62,   61,   61,   61, // 240.. 249
  61,   60,   60,   60,   60,   59,   59,   59,   59,   58, // 250.. 259
  58,   58,   58,   57,   57,   57,   57,   56,   56,   56, // 260.. 269
  56,   55,   55,   55,   55,   55,   54,   54,   54,   54, // 270.. 279
  54,   53,   53,   53,   53,   53,   52,   52,   52,   52, // 280.. 289
  52,   51,   51,   51,   51,   51,   50,   50,   50,   50, // 290.. 299
  50,   50,   49,   49,   49,   49,   49,   49,   49,   49, // 300.. 309
  48,   48,   48,   48,   48,   48,   47,   47,   47,   47, // 310.. 319
  47,   47,   47,   46,   46,   46,   46,   46,   46,   45, // 320.. 329
  45,   45,   45,   45,   45,   45,   45,   44,   44,   44, // 330.. 339
  44,   44,   44,   44,   44,   43,   43,   43,   43,   43, // 340.. 349
  43,   43,   43,   42,   42,   42,   42,   42,   42,   42, // 350.. 359
  42,   41,   41,   41,   41,   41,   41,   41,   41,   40, // 360.. 369
  40,   40,   40,   40,   40,   40,   40,   39,   39,   39, // 370.. 379
  39,   39,   39,   39,   39,   39,   38,   38,   38,   38, // 380.. 389
  38,   38,   38,   38,   38,   37,   37,   37,   37,   37, // 390.. 399
  37,   37,   37,   37,   36,   36,   36,   36,   36,   36, // 400.. 409
  36,   36,   36,   35,   35,   35,   35,   35,   35,   35, // 410.. 419
  35,   35,   35,   34,   34,   34,   34,   34,   34,   34, // 420.. 429
  34,   34,   34,   34,   34,   33,   33,   33,   33,   33, // 430.. 439
  33,   33,   33,   33,   33,   33,   33,   32,   32,   32, // 440.. 449
  32,   32,   32,   32,   32,   32,   32,   32,   32,   31, // 450.. 459
  31,   31,   31,   31,   31,   31,   31,   31,   31,   31, // 460.. 469
  31,   30,   30,   30,   30,   30,   30,   30,   30,   30, // 470.. 479
  30,   30,   30,   30,   30,   29,   29,   29,   29,   29, // 480.. 489
  29,   29,   29,   29,   29,   29,   29,   29,   29,   29, // 490.. 499
  28,   28,   28,   28,   28,   28,   28,   28,   28,   28, // 500.. 509
  28,   28,   28,   28,   28,   27,   27,   27,   27,   27, // 510.. 519
  27,   27,   27,   27,   27,   27,   27,   27,   27,   27, // 520.. 529
  26,   26,   26,   26,   26,   26,   26,   26,   26,   26, // 530.. 539
  26,   26,   26,   26,   26,   25,   25,   25,   25,   25, // 540.. 549
  25,   25,   25,   25,   25,   25,   25,   25,   25,   24, // 550.. 559
  24,   24,   24,   24,   24,   24,   24,   24,   24,   24, // 560.. 569
  24,   24,   24,   23,   23,   23,   23,   23,   23,   23, // 570.. 579
  23,   23,   23,   23,   23,   23,   23,   22,   22,   22, // 580.. 589
  22,   22,   22,   22,   22,   22,   22,   22,   22,   22, // 590.. 599
  22,   21,   21,   21,   21,   21,   21,   21,   21,   21, // 600.. 609
  21,   21,   21,   21,   21,   20,   20,   20,   20,   20, // 610.. 619
  20,   20,   20,   20,   20,   20,   20,   20,   20,   20, // 620.. 629
  20,   20,   19,   19,   19,   19,   19,   19,   19,   19, // 630.. 639
  19,   19,   19,   19,   19,   19,   19,   19,   19,   19, // 640.. 649
  18,   18,   18,   18,   18,   18,   18,   18,   18,   18, // 650.. 659
  18,   18,   18,   17,   17,   17,   17,   17,   17,   17, // 660.. 669
  17,   17,   17,   17,   17,   17,   16,   16,   16,   16, // 670.. 679
  16,   16,   16,   16,   16,   16,   16,   16,   16,   15, // 680.. 689
  15,   15,   15,   15,   15,   15,   15,   15,   15,   15, // 690.. 699
  15,   14,   14,   14,   14,   14,   14,   14,   14,   14, // 700.. 709
  14,   13,   13,   13,   13,   13,   12,   12,   12,    0, // 710.. 719
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 720.. 729
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 730.. 739
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 740.. 749
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 750.. 759
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 760.. 769
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 770.. 779
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 780.. 789
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 790.. 799
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 800.. 809
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 810.. 819
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 820.. 829
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 830.. 839
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 840.. 849
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 850.. 859
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 860.. 869
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 870.. 879
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 880.. 889
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 890.. 899
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 900.. 909
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 910.. 919
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 920.. 929
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 930.. 939
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 940.. 949
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 950.. 959
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 960.. 969
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 970.. 979
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 980.. 989
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, // 990.. 999
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //1000..1009
   0,    0,    0,    0,    0,    0,    0,    0,    0,    0, //1010..1019
   0,    0,    0,    0;                                     //1020..1023
Anmerkungen dazu:
1. Ich verwende nur ganzzahlige Werte (auf +- 1 cm genau)
2. Die Distanzwerte beziehen sich auf meinen Aufbau. Bis zur Grundplatte des Sensors müßte man zu allen Werten 3,5 cm addieren.
3. Die Tabelle ist die für meinen linken Sensor. Die für den rechten sieht besonders in den höheren Distanzen wieder anders aus. Es bleibt also nichts übrig,- man muss selbst für jeden seiner Sensoren eine Tabelle anlegen. Von den 1024 Werten sind das immer noch ca. 600 pro Sensor.

Gruß Dirk