cylon.js & arduino uno: 在没有电缆连接到 PC 的情况下执行程序

cylon.js & arduino uno: execute program without cable connection to PC

我是这个领域的新手,所以这可能是一个奇怪的问题。 我们可以在 aduino IDE 中编写代码(比如闪烁的灯)并将其上传到 arduino,然后我们可以断开与 pc 的连接,程序将 运行。 (会发生闪烁)。 现在当我们使用 cylon.js 并编写程序并执行 say

$ node blinking.js

然后只要 arduino 连接到 pc(或笔记本电脑),就会发生闪烁,当我杀死节点 js 或断开 arduino 与 pc 的连接时,闪烁就会停止。 (这就是它应该如何发生的,对吧?)

所以我的问题是, 如果我有一个带温度传感器的 arduino,在室外某个地方,我有一个 cylon.js 程序来使用这些传感器数据并做一些事情(比如打印它们),那么我该如何实现呢?我是否必须有两个通过无线或 gsm 屏蔽连接的 arduino(一个连接到 cylon.js 是 运行ning 的 pc)?

或者有没有简单的方法可以做到这一点?非常感谢任何对此的见解。

谢谢

then as long as the arduino is connected to the pc(or laptop) the blinking happens and when I kill node js or disconnect arduino from pc the blinking stops. (this is how its suppose to happen, right?)

正确。对于任何 Node.js 控制 Arduino 的程序都是如此,无论是 Cylon.js 还是 Johnny-Five。

if I have a arduino with a temperature sensor some where outdoor and I have a cylon.js program to use those sensor data and do some things (say print them), then how can I achieve this ?

Arduino 板是不可能的。您可以使用一对 Xbee 模块,这将允许您的 Arduino 与主机通信,或者只使用具有 wifi 或蓝牙功能的板,例如:

  • Spark 核心
  • 电子小鬼
  • 英特尔伽利略
  • 英特尔爱迪生
  • Raspberry Pi
  • BeagleBone
  • pcDuino