我使用USB将Arduino连接到我的笔记本电脑,并且可以使用Processing读取串行数据。如何从JavaScript读取串行端口数据
有什么办法可以将这些数据实时获取到本地浏览器中吗?例如,显示串口值的文本字段?它不必连接到互联网。
Processing版本的JavaScript不支持以下代码,这将是理想的解决方案。
处理代码为:
myPort = new Serial(this, Serial.list()[0], 9600);
// read a byte from the serial port
int inByte = myPort.read();
// print it
println(inByte);
// now send this value somewhere...?
// ehm...
你应该看看这个:https://github.com/rwaldron/johnny-five。也许它可以帮助你。 – kmas