Start NodeJS
Type in the console:
Node
this will open the NodeJS interpreter. You could type something like:
console.log('Hello World!');
This should show something like:
Hello World!
undefined
That was easy, wasn’t it?
<br>
Use persistence for the script
Instead of typing everything in the NodeJS interpreter, you can also put the script in a .js file. This .js file can then be called by the NodeJS interpreter.
Open an editor, learn to use vi or install nano (preferred).
Blink the led
Code in Arduino IDE.
Note: You’ll want to eventually map out the Edison’s GPIO’s into their corresponding Arduino IDE pin numbers (check links at the bottom of this page), but for right now we’ll just focus on D0 (or J18-P13 on the breakout board)
void setup() {
//Digital Pin 0 in Arduino IDE is mapped to J18-P13 on the Edison breakout board
pinMode(0, OUTPUT);
}
void loop() {
//Tun on the LED
digitalWrite(0,HIGH);
delay(1000);
//Turn off the LED
digitalWrite(0,LOW);
delay(1000);
}