Skip to content

A python module for controlling motors via a L298N Dual H-Bridge DC motor driver.

License

Notifications You must be signed in to change notification settings

piwi3910/l298n-speed

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

l298n-speed Module

This module is designed to be used with three GPIO pins on the Raspberry Pi. the enable pin sets the speed and the other two the direction

Usage

First, create an instance of l298n-speed using 3 GPIO pin numbers from the raspberry pi as attributes. Use the GPIO number as opposed to the board number.

attributes are in following order: enable pin, pin 1, pin 2 most l298n board name them: ena, in1, in2

from l298n import l298n
motor = l298n(1, 2, 3)

Then, using methods from l298n, a motor can be activated in the desired direction.

motor.forward(80)
motor.backward()
motor.stop()

if no speed is given it will be set to 100, else a pwm signal will be set to lower the speed

Contributions

If you see areas for improvement in this module, please submit an issue or feel free to email me. All contributions are welcome.

About

A python module for controlling motors via a L298N Dual H-Bridge DC motor driver.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%