Servus hedi!
Wenn man weiß, wie's geht, ist's ganz einfach
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41:
| unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;
type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end;
var Form1: TForm1;
implementation
{$R *.DFM}
procedure PortOut(Port : Word; Data : Byte); stdcall; external 'io.dll'; function PortIn(Port:Word):Byte; stdcall; external 'io.dll';
procedure TForm1.Button1Click(Sender: TObject); var Gelesen: Byte; DingDran: Boolean; begin Gelesen:=PortIn($379); if (Gelesen and $10)=0 then DingDran:=False else DingDran:=True; end;
end. |
Im Beispiel gehe ich davon aus, daß Du eine Leitung vom Pin25(GND) auf Pin13(SLCT) auf der Platine mit der 7-Segment-Anzeige gezogen hast. Der SLCT-Eingang wird über Bit4(0..7) abgefragt, ist das Bit4=0, dann liegt an SLCT Masse-Potential. Da die LPT-Schnittstelle interne Pull-up-Widerstände hat, ist also bei offenem Eingang das Bit4=1. Und wie ich schon sagt: Die Ausgänge bleiben vom Zustand der Eingänge unbeeinflußt.
Gruß,
Adrian
(Bzgl. Deiner PN: nix für ungut)