Do not tell me where you can see a simple example of working with a com port? Also, is it possible to turn the LED on and off at the com-port of delphi?
4 answers
Here is the component and description with examples for working with ComPort. simple ignition of the LED, as with LPT by ComPot does not work out, since ComPort is a serial port, and LPT is parallel. Yes, and the current will not stand COM COM.
- Do not tell me how you can turn on and off the LED at the LTP port from delphi? - Sarvar
- Duck you LPT or whom you need? LPT has a good
Inout32.dlllibrary, it exports 2 functions: write to port and read from port. - SoftR - I want to control external devices using Delphi. For example, turn on and off the LEDs or control the motors. - Sarvar
- oneWell, all the same for the management of external peripherals will be easier to use LPT. And how to help you? I do not know your knowledge of programming, as the task is not difficult. Here is an article that describes in some detail the principle of working with LPT with Delphi - SoftR
- THANK YOU VERY MUCH!!! - Sarvar
LPT port is best suited for ignition of LEDs. For com port at no additional cost, nothing will come of it. Well, except that 1 LED light :)
- Well, why not come out? And why one? Although the use for com port is not the best. - Alexey Kotov
- Do not tell me how you can turn on and off the LED at the LTP port from delphi? - Sarvar
You can try to take advantage of this . About LED - I mean how to connect the LED to the port? You can try through a banal ballast. If a special brightness is not needed, then it will do. Changing the pulse ratio can be controlled by brightness. Consider only the amplitude of the signal at the port output (-12 ... + 12 V).
- Do not tell me how you can turn on and off the LED at the LTP port from delphi? - Sarvar
Everything has been around for a long time at DelphiKingdom:
In short, comports are available in Windows as files named \\.\COM1 , \\.\COM2 so on. Accordingly, the work with them is carried out mainly by WinAPI tools of CreateFile , ReadFile , WriteFile , CloseHandle .
- Do not tell me how you can turn on and off the LED at the LTP port from delphi? - Sarvar