کار با پرت پرینتر

aynaz_t

عضو جدید
سلام دوستان.کسی میتونه منو در مود برنامه نویسی c با استفاده از پرت پرینتر راهنمایی کنه؟خییییییییلی ضروریه.ممنونم اگه کمکم کنین
 

H.r.Ghanbari

عضو جدید
Reply: Parallel Port

Reply: Parallel Port

با inpout32.dll می تونی با پورتها کار کنی:

کد:
// InpoutTest.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
/* ----Prototypes of Inp and Outp--- */

short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);

/*--------------------------------*/

int main(int argc, char* argv[])
{

    int data;

    if(argc<3)
    {
        //too few command line arguments, show usage
        printf("Error : too few arguments\n\n***** Usage *****\n\nInpoutTest read <ADDRESS> \nor \nInpoutTest write <ADDRESS> <DATA>\n\n\n\n\n");
    } 
    else if(!strcmp(argv[1],"read"))
    {

        data = Inp32(atoi(argv[2]));

        printf("Data read from address %s is %d \n\n\n\n",argv[2],data);
    
    }
    else if(!strcmp(argv[1],"write"))
    {
        if(argc<4)
        {
            printf("Error in arguments supplied");
            printf("\n***** Usage *****\n\nInpoutTest read <ADDRESS> \nor \nInpoutTest write <ADDRESS> <DATA>\n\n\n\n\n");
        }
        else
        {
        Out32(atoi(argv[2]),atoi(argv[3]));
        printf("data written to %s\n\n\n",argv[2]);
        }
    }


    return 0;
}
Source + DLL + LIB + ...
پروژه رو به زبان های
C# , VC++
می تونی از اینجا دانلود کنی!;)
 

پیوست ها

  • LED_Source.rar
    16.3 کیلوبایت · بازدیدها: 0
  • inpout32_source_and_bins.zip
    65.3 کیلوبایت · بازدیدها: 0

Similar threads

بالا