如何使用并行端口和Turbo C控制LED [英] How to Control LEDs using Parallel Port and Turbo C
问题描述
大家好。
我需要一些帮助。如何使用并行端口和Turbo C控制8个LED,如二进制计数等。我只知道C语言,所以请帮我查看源代码。 C中是否需要Inpout32.dll?请帮忙。
顺便说一下,我只是一个初学者,所以我希望你能理解。任何帮助将高度赞赏。在此先感谢!
此问题已在C#论坛中得到解答。
#include < stdio.h >
#include < string.h >
#include < conio.h >
#include < dos.h >
int main(void)
{
int i,port = 0x378;
for(i = 0; i < 2; i ++)
{
outportb(port, 0xff);
< span class =code-attribute> getch();
< span class =code-attribute> outportb(port, 0);
< span class =code-attribute> getch();
}
return 0;
}
确保设备管理器的端口地址,并行端口,属性,I / O范围。
https://www.facebook.com/groups/comp.programmers/permalink/10151166007575911/?comment_id=10151166053485911¬if_t=like [ ^ 一>
Hello to everyone.
I need some help. How can I control 8 LEDs using Parallel Port and Turbo C, like counting in Binary, etc. I only know C language so please help me for the source code. Is there Inpout32.dll that will need in C? please help.
By the way, I''m just only a beginner so I hope you understand. Any help will highly appreciated. Thanks in Advance!
This question has been answered in the C# forum.
#include <stdio.h> #include <string.h> #include <conio.h> #include <dos.h> int main(void) { int i, port = 0x378; for (i = 0; i < 2; i++) { outportb(port, 0xff); getch(); outportb(port, 0); getch(); } return 0; }
Make sure about the port address from device manager, parallel port, properties, I/O Range.
https://www.facebook.com/groups/comp.programmers/permalink/10151166007575911/?comment_id=10151166053485911¬if_t=like[^]
这篇关于如何使用并行端口和Turbo C控制LED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!