Einzelnen Beitrag anzeigen

happyaura

Registriert seit: 12. Jan 2005
Ort: Hamburg
73 Beiträge
 
Delphi 6 Personal
 
#4

Re: IOWarrior - Fernbedienung defekt???

  Alt 26. Jan 2005, 23:46
leider ließen sich auch einer anderen Fernbedienung keine Toggels entlocken. keiner 'ne idee? oder liegt es an meiner ausgabe? kann ich mir eigentlich auch nicht vorstellen, dann hätte ich wohl grundlegendes nicht verstanden. ich poste sie hier einfach noch mal:

Delphi-Quellcode:
type
  TKeyData = record
    Command: Byte; // decoded RC5 command
    Address: Byte; // decoded RC5 address
    Toggle: Boolean; // toggles with any key press on IR remote
    Key: Word; // assigned key
    Shift: TShiftState; // assigned Ctrl/Alt/Shift
    ExtendedKey: Boolean; // numpad bit for key
  end;

[...]

procedure DecodeRC5Data(const Report: TIOWarriorIRInputReport;
  var KeyData: TKeyData);
begin
  // 6 bits used
  KeyData.Command := Report.Command and $3F;
  // Bit 6 of Command is stored inverted in Address
  KeyData.Command := KeyData.Command or
    ((not Report.Address) and $40);
  // 5 bits used
  KeyData.Address := Report.Address and $1F;
  // the toggle bit changes each time a different key
  // is pressed on the IR remote
  KeyData.Toggle := (Report.Address and $20) <> 0;
end;


[...]

// Ausgabe des togglebits aufruf bei jedem senden der Fernbedienung (mehrmals pro tastendruck)

  if KeyData.Toggle then
         label2.caption:='Toggle: true'
  else
         label2.caption:='Toggle: false';
Sieht für mich alles richtig aus.
mir mangelt es echt an ideen, woran es noch liegen könnte. auch wenn es an delphi kenntnissen noch ein wenig mangelt, besteht doch einiges an allgemeinen programmierkenntnissen.
  Mit Zitat antworten Zitat