A simple NodeJS application to control an LED connected to an Arduino. This project is written in TypeScript and is configured with ts-node to directly run the TypeScript files and uses the johhny-five library.
- Code editor/IDE (Visual Studio Code recommended)
- Arduino IDE
- Arduino board w/ wire to connect to device
- LED
- NodeJS
- Connect the positive side of the LED (long side) to port 13 and the negative side (short side) to ground
- Connect the Arduino to your device with the wire
- Open up the Arduino IDE. Go to Tools > Board and Tools > Port to ensure the correct board and port is selected
- Go to File > Examples > Firmata and select "StandardFirmataPlus"
- Upload the code to the Arduino
- Download the code zip file from the GitHub repository and unzip it
- Open the unzipped folder in your code editor/IDE
- Run
npm install
(oryarn add
if you're using yarn) to install dependencies specified in package.json in either your editor/IDE's in-built terminal or navigate to the project folder on your device's terminal and then run the command - Run
npm run arduino
in either your editor/IDE's in-built terminal or device terminal
You should see something similiar to the following in the terminal:
1643260827430 Available COM3
1643260827441 Connected COM3
1643260829130 Repl Initialized
as well as the LED blinking.
If you find any issues, security vulnerabilities or a have featureq requests, you can open a new issue. If you'd like to contribute, create a fork, apply your changes and then open a pull request.
Need help? Feel free to contact me on Discord (tncz) or via email (ascendus.dev@gmail.com).
This project is licensed under the CC0 1.0 Universal License.