如何使用并行端口和Turbo C控制LED [英] How to Control LEDs using Parallel Port and Turbo C

查看:70
本文介绍了如何使用并行端口和Turbo C控制LED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。



我需要一些帮助。如何使用并行端口和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&notif_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&notif_t=like[^]


这篇关于如何使用并行端口和Turbo C控制LED的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆