How to conect Javascript and Arduino
We have find information in this link in Spanish.
Here's how you can make a project using Arduino and Javascript.
The objective of the project is to switch a LED on when an image is detected by a Neural Network
Here's a list of the software needed for this project:
You need to follow these steps:
- Connect a LED in pin 13 of an Arduino
- Install Arduino software in pendrive
- Install drivers for Arduino recognition found in folder drivers
- Check the port number in Arduino menu, e.g. COM3 and click on it to be sure of port recognition
- Under examples of Arduino software, upload Arduino Standard-Firmata
- Install node.js 8.9.4 LTS version. It is a JavaScript server listening to http://localhost:8080 or http://127.0.0.1:8080
- Open the Unix terminal and execute "node hello.js" to check server is working
- Write in terminal "npm install johnny-five" this is a node package manager (NPM) found at npmjs.org
- Install the rest of the software that we said that we needed for this project writing in the terminal:
- npm install express
- npm install socket.io --save
- npm install arduino-firmata
- Alternative to NPM is Bower because is another powerfull package manager. To use bower you need to install git from github.com and write in the terminal "npm install -g bower"