-
-
Erfahrener Benutzer
Fleißiges Mitglied
Das Programm, erklärt sich von selbst:
//------------------------------------------------------------------------------
//Autor : Yusuf Kuzu
//Programm: Ansprechen des Parallel Port´s
//------------------------------------------------------------------------------
#include <conio.h>
#include <iostream.h>
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "parallel.h"
#include "parallel.cpp"
//------------------------------------------------------------------------------
inpfuncPtr inp32fp;
oupfuncPtr oup32fp;
short Daten=0;
void display (short);
void display (short input)
{
Daten=Inp32(PPORT_BASE);
Out32(PPORT_BASE, input);
}
//------------------------------------------------------------------------------
int main()
{
HINSTANCE hLib;
int INF=0, i=0, Zeit=0;
//-----------------------Bibliothek wird geladen-------------------------------
hLib=LoadLibrary("inpout32.dll");
if (hLib==NULL)
{
cout<<"inpout32.dll nicht vorhanden"<<endl;
cout<<" PROGRAMM WIRD BEENDET "<<endl;
exit(0);
}
//------------------------Befehl wird geladen----------------------------------
inp32fp=(inpfuncPtr) GetProcAddress(hLib, "Inp32");
if (inp32fp==NULL)
{
exit (0);
}
//------------------------Befehl wird geladen----------------------------------
oup32fp=(oupfuncPtr) GetProcAddress(hLib, "Out32");
if (oup32fp==NULL)
{
exit (0);
}
//-----------------------------------------------------------------------------
cout<<"Wartezeit eingeben (in ms): "<<endl;
cin>>Zeit;
if(Zeit<1) {Zeit=1;} //wenn Zeit 0 ist wird es auf 1 gesetzt
display(0); //alles wird auf 0 gesetzt
//------------------------------Ausgabe----------------------------------------
for(i=0; i<256; i++)
{
display(i); //Ausgabe erfolgt binär (z.B. 0010 0011)
Sleep(Zeit); //das Programm wartet an dieser Stelle
}
//-----------------------------------------------------------------------------
display(0); //alles wird auf 0 gesetzt
FreeLibrary("inpout32.dll");
getch();
return 0;
}
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
-
Foren-Regeln
Lesezeichen