hardware interfacing through c
I have been trying to look for a c or c++ tutorial that has instructions on hardware interfacing code.
Provide a link or any other source.
what are you interfacing to?
I just want to interface a hand wired circut through the parallel port using visual c++
I would be glad to receive any general tutorial on interfacing using visual or borland c++.
Dear Kotis, well you can interface any device using parallel port the only thing you need to have is a NPN Transistor, just conenct the base of the transistor to the Data Pin of the parallel port and then connect a relay to the emitter of and provide a vcc to the collector, the relay will be connected to your device which will be operational when the transistor is switched on, there are 8 Data Pins thus you k connect upto 8 Bits of Devices that is at most 255 Devices and control them simultaneously...the control command syntax for c/c++ is
outport(0x378,a);
here 0x378 is the parallel ports address and 'a' is a variable depending on the value data pins of the parallel port will by high/low, thus operating the specific transistor/device,...
Best Regards
Jamshid Dastur
Hi
Using C and C++ use the follwing two commands
InPort(adress) or inportB(addresss) to receive data from parallel port
Outport(address, data) or outportb(address, data) send data to parallel port
use an IC to protect your parallel port. Just search for that IC because I forgot to the name of it. It will be very risky to damage your parallel port.
Regards,
Necolei