parallel port programming problem

Discussion in 'Embedded Systems and Microcontrollers' started by khan yousufzai, Oct 18, 2012.

  1. khan yousufzai

    Thread Starter New Member

    Aug 31, 2012
    19
    0
    please send me basic commands for accessing pc parallel port c coding on visual c++ ,

    i typed following program but it compile correctly but doesnt access parallel port,

    #include<stdio.h>
    #include<conio.h>

    #define portaddress 0x378

    int main()
    {
    int a;
    printf("Enter a number:");
    scanf_s("%d",&a);
    if(a<9)
    {
    _outp(portaddress,0x00);
    }
    else
    {
    _outp(portaddress,0x255);
    }
    system("pause");
    return 0;
    }
    //i have winxp i have lpt1 driver,pinout32 userport almost all the thing,but still it doesnt work ,i have tried many different codes
     
  2. jt6245

    Member

    Feb 18, 2011
    21
    3
Loading...