使用Java进行灯光控制
在阅读Eckel的《Thinking in Java》时,我发现了控制Greenhouse的设计。这真的让我震惊,因为他在评论行中提到“这里放置用于控制灯的硬件代码”之类的东西,我想知道 - 我将如何制作如此简单的事情,例如用 Java 控制物理灯或交通灯程序?
如何通过软件控制将灯连接到 PC 并为其供电?
我相信用一些微控制器的汇编语言是可行的,但我还不打算学习汇编语言,所以我想知道是否有可能用Java来做到这一点?
谢谢, M。
when reading Eckel's Thinking in Java, I found design for controlling Greenhouse. It really struck me, since he was mentioning in comment lines "here put the hardware code for controlling light" and stuff, and I want to know - how would I make such a simple thing, as controlling physical light, or traffic light with Java program?
How would I connect light to PC and power it, through software control?
I believe assembly language with some microcontroller is the way, but I do not intend to learn assembly language yet, so I want to know if there's possibility to do this with Java?
Thanks,
M.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另一个示例是 KNX,它的绑定是 openhab。
Another example is KNX, a binding for it is part of openhab.
我最近一直在玩 Arduino。编写一个通过串行方式与开发板对话的 Java 程序并不太难,开发板控制电机、LED 等。 Arduino 编程语言非常简单,并且基于 C,因此只要具备一些 Java 知识,这应该很简单。
I've recently been playing around with Arduino. It's not too difficult to write a Java program which talks to the board over serial, with the board controlling motors, leds or the like. The Arduino programming language is quite simple and based on C so with some java knowledge this should be straightforward.
几个月前我用谷歌搜索了这个。找到了一个叫做 X10 的东西和这个网站。可能是寻找有关控制灯光等更多信息的开始。
http://x10controller.sourceforge.net/ X10Client/index.html
http://www.x10.com/homepage.htm
I googled this a couple of months ago. Found something called X10 and this site. Might be a start for finding more information about controlling light etc.
http://x10controller.sourceforge.net/X10Client/index.html
http://www.x10.com/homepage.htm
Calimero NG是在java上开发的用于同源控制的API。
Calimero NG is API develop on java for homo control.