cylon.js & arduino uno: execute program without ca

2019-08-15 04:29发布

问题:

I am new to this field, so this might be an odd question. We can write a code(say blinking lights) in the aduino IDE and upload it to arduino and we can disconnect from the pc and the program will run. (blinking will happen). Now when we are using cylon.js and write the program and execute say

$ node blinking.js

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?)

So my question is, 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 ? Do I have to have two arduinos which are connected via wireless or gsm shields (one outdor and one connected to the pc where the cylon.js is running)?

or is there a simple way of doing this? Any insight on this is much appreciated.

Thank you

回答1:

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?)

Correct. This is true for any Node.js program controlling an Arduino, whether with Cylon.js or 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 ?

It's not possible with just an Arduino board. You can use a pair of Xbee modules, which will allow your Arduino to communicate with the host machine, or just use a board that has wifi or bluetooth capabilities, such as:

  • Spark Core
  • Electric Imp
  • Intel Galileo
  • Intel Edison
  • Raspberry Pi
  • BeagleBone
  • pcDuino