Skip to content

Latest commit

 

History

History
26 lines (14 loc) · 656 Bytes

README.md

File metadata and controls

26 lines (14 loc) · 656 Bytes

sudo apt install python3-rpi-lgpio

In project folder: python3 -m venv --system-site-packages venv

pip install -r requirements.txt

In .py file: import RPi.GPIO as GPIO ... ...

To test: python motor_api_server.py

curl -X POST http://[Your_Raspberry_Pi_IP_Address]:5000/speed -H "Content-Type: application/json" -d '{"speed": 50}'

curl -X POST http://[Your_Raspberry_Pi_IP_Address]:5000/stop

curl -X POST http://[Your_Raspberry_Pi_IP_Address]:5000/direction -H "Content-Type: application/json" -d '{"direction": true}'

curl -X POST http://[Your_Raspberry_Pi_IP_Address]:5000/direction -H "Content-Type: application/json" -d '{"direction": false}'