23 lines
624 B
Python
23 lines
624 B
Python
####################################################################
|
|
# This file contains the code to control the motors of the robot.
|
|
#
|
|
# The motors are controlled using PWM signals.
|
|
# The code is designed to work with the L298N motor driver.
|
|
# The code is designed to work with the Raspberry Pi 5.
|
|
######################################################################
|
|
from gpiozero import Motor, PWMOutputDevice
|
|
|
|
|
|
class TMotor:
|
|
def __init__(self, motor_pin1, motor_pin2, pwm_pin):
|
|
pass
|
|
|
|
def forward(self, speed):
|
|
pass
|
|
|
|
def backward(self, speed):
|
|
pass
|
|
|
|
def stop(self):
|
|
pass
|