Skip to content

Very basic example of GPIO using Raspberry Pi 5 with Python

Notifications You must be signed in to change notification settings

benjvrgit/motor_control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}'

About

Very basic example of GPIO using Raspberry Pi 5 with Python

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages