Probably this readme have so much errors in English grammar because I am not much skilled in english language. So if you find any error, just contact me. =)
- This an API to control the pins of an arduino. It can be modded to suports another types of components as such some sensors or rgb leds.
- The project can be easily moddified to add some features as authentication, or may be the backend of a React.js app.
- An arduino or microcontroller that is supported by node.js module Johnny-Five
- A computer
- Creativity
-
An Arduino Uno
-
A protoboard
-
1x 330ohm resistor
-
1x Red Led
To control this system, i have build a simple web page to check power and control the red led!
This simple static page is running on with this api at:
http://localhost:3300/
Download it using
git clone https://github.com/gabrielgollo/arduino-pin-control-nodejs.git
Install modules using
npm i
-
Configure the .env passing the pin port in the array. Example of passing the pin port 13:
Arduino_Pins = ['13']
-
Make a request to http://localhost:3300/pinport/:pin/:mode , where :pin is equal to Pin Port and :mode is one of ['on', 'off', 'toggle']. Examples:
http://localhost:3300/pinport/13/on <-- This will power on the pinport 13 http://localhost:3300/pinport/13/off <-- This will power off the pinport 13