打开LED上的Arduino与Java [英] Turn on the LED on Arduino with Java
问题描述
我安装了Java串行RXTX库和得到了我的Arduino树立正确的。我甚至有样品code运行起来,但我似乎无法理解如何访问不同的Arduino的引脚,以把一个LED为例。如何访问引脚与OutputStream的或任何其他方式?
I installed the Java serial RXTX libraries and got my Arduino set up right. I even have the sample code up and running, but I can't seem to understand how to access the different Arduino pins in order to turn a LED for example. How can I access the pins with the OutputStream or any other way?
我是否需要发送一些特殊的数据流,以告诉它有关特定针?
Do I need to send something special to the stream in order to tell it about a specific pin?
推荐答案
我不知道我的code怎么读,多么容易,你可以安装它,但我写了一个小项目通过交谈到Arduino RXTX。你可以在这里看到我的code:
I am not sure how readable my code is, or how easily you can install it, but I wrote a small project to talk to the Arduino via RXTX. You can see my code here:
https://github.com/p90puma/SerialToIR
这应该给你一些想法。
It should give you some ideas.
这三个文件应该给你一切你需要:
These three files should give you everything you need:
-
<一个href=\"https://github.com/p90puma/SerialToIR/blob/master/ArduinoWS/src/main/java/com/p90puma/arduinows/ArduinoSerialPortListener.java\"相对=nofollow> RXTX code
<一个href=\"https://github.com/p90puma/SerialToIR/blob/master/ArduinoWS/src/main/java/com/p90puma/arduinows/ArduinoWS.java\"相对=nofollow>接口
这篇关于打开LED上的Arduino与Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!