如果将灯连接到继电器,然后通过并行端口连接到电路,我可以看到该灯的状态吗? [英] if connected a light to relay and then to the circuit by the parallel port can i see the status of that light?

查看:65
本文介绍了如果将灯连接到继电器,然后通过并行端口连接到电路,我可以看到该灯的状态吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iv将灯连接到我的电路并正常工作,因此我将其打开,反之亦然
但是我问这个问题((我可以在c#中显示灯的状态,如果灯开或关?))
请举个例子吗?

感谢

iv connect a light to my circuit and its working so i turn it on and vice versa
but im asking about that ((can i in c# show the status of the light if its on or off ??))
with example please?

thanks

推荐答案

您无法读取电灯的状态:它是电力的消耗者,而不是供应商.

您可以阅读开关(以及按钮不会关闭的开关).您可以读取任何提供适当数字输出的设备.但是不,你看不懂灯光.

如果将源馈送到端口,则可以读取该源是否由外部源供电.但我不建议这样做-如果您在电源上输入的电压错误,则可能会炸掉PC的一部分.最好使用缓冲芯片-查看74系列 http://rabbit.eng.miami.edu/info/datasheets / [^ ]错了,您浪费了便宜的IC!
74LS32或74HCT32或类似产品应该可以解决问题.


"感谢您的回答
但我希望我的电路没有任何类型的集成电路或微型飞船.
我可以通过c#知道例如继电器编号1是在5v stat还是0v?
或如何知道设备是打开还是关闭?"


适合自己,这是您要冒险的PC,而不是我的!

是的,如果它是0V或5V,则可以读取到继电器的驱动线的状态.
但是,如果要从同一并行端口控制继电器,则可能会更困难.

此处看看 [
You can''t read the status of a light: it''s a consumer of electricity, not a supplier.

You can read switches (and buttons which are switches that don''t stay shut). You can read any device which gives an appropriate digital output. But no, you can''t read a light.

You can read if it is being powered by an external source if you feed the source into the port. But I don''t recommend it - if you get the voltage wrong on the source, you could fry parts of your pc. Better to use a buffer chip - look at the 74 series http://rabbit.eng.miami.edu/info/datasheets/[^] as if you get that wrong you waste a cheap IC instead!
A 74LS32 or 74HCT32 or similar should do the trick.


"thanks for ur answers
but i want my circuit without any types of ics or microships.
can i by c# know if the relay number 1 for example is on 5v stat or is 0v?
or how to know if the device is on or off?"


Suit yourself, it''s your PC you are risking, not mine!

Yes you can read the status of the drive line to the relay if it is 0V or 5V.
It may be harder if you are controlling the relay from the same parallel port, though.

Have a look here[^] it may help.


是的,搜索并了解并行端口编程...
Yes, Search and learn about parallel port programming...


您可以漫游的好地方是http://channel9.msdn.com/ [ ^ ]

看看有趣的部分的编码
The good place you can roam around is http://channel9.msdn.com/[^]

Look at the coding for fun section


这篇关于如果将灯连接到继电器,然后通过并行端口连接到电路,我可以看到该灯的状态吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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