Skip to content

samwelkinuthia/Node-React-js-servo-control-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Servo Control

Controlling servomotor with Create React App and Node Js.

Prerequisites

  • Raspberry pi
  • Node Js
  • pigpio C library

Running

Open a terminal on your machine and do the following:

  • Clone this repository
  • Run npm install in project root
  • Move the server folder to your raspberry pi.
    • On the raspberry Pi
      • Install pigpio by running sudo apt-get install pigpio
      • Ensure node js is installed
      • Navigate into the server folder and run npm install
      • Run npm start to start the backend server at https://localhost:5000
      • This code works with the yellow servomotor wire connected to pin 17. Edit server.js to in case you want to use a different pin.
  • Navigate back to the project root and run npm start to start the frontend server at https://localhost:3000.
  • Edit Rotate.js and replace your_raspberry_pi_address wih your actual pi address.

Servomotor connection

Other

  • Check out Node Schedule for cron-like scheduling.
  • Check out Pigpio to control other devices on the pi using js such as accelerometers, LEDs and ultrasonic sensors

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published