I wrote this code in Visual c++ to control LED's through parallel port:
// InpoutTest.cpp : Defines the entry point for the console application. //
#include "stdafx.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include <conio.h>
short _stdcall Inp32(short PortAddress);
void _stdcall Out32(short PortAddress, short data);
int main(int argc, char* argv[])
{
Out32(888, 255);
system("pause");
Out32(888, 0);
return 0;
}
Now, what I thought was that the line 'Out32(888, 255);' will write 1 in all data registers, and all LED'd connected from D0 to D7 will turn on; but nothing happened, the led's which were on before execution remained on and same case with the led's which were off.
Same was the case with 'Out32(888, 0);', no led's were turned off.
What is wrong in the above code? I used 'Inpoutx64.dll' as I'm working on 64 bit OS (windows 8). I also included 'Inpoutx64.lib' in project properties > linked > input > Additional dependencies.
I've also copied "inpoutx64.dll' to Windows/system 32
Make sure you have inpoutx64.dll in the same directory as your generated .exe file, and that you have run the InstallDriver.exe program included with inpoutx64.dll, and allowed UAC elevation, in order to install the required system driver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With