Pen Plotter Project
servo_driver.ServoDriver Class Reference

This class implements a MG 996R servo. More...

Public Member Functions

def __init__ (self, en_pin, pwm_pin, timer)
 Instantiates servo object by setting enable pin to high and creating timer/timer channel objects for PWM control. More...
 
def pen_down (self)
 Send PWM signal moving the pen down in contact with the page.
 
def pen_up (self)
 Send PWM signal moving the pen up to no longer touch the page.
 

Public Attributes

 t
 50Hz timer at specified PWM pin timer number on Nucleo
 
 tch
 Timer channel used to send PWM signal for specified Nucleo pin.
 

Detailed Description

This class implements a MG 996R servo.

Constructor & Destructor Documentation

◆ __init__()

def servo_driver.ServoDriver.__init__ (   self,
  en_pin,
  pwm_pin,
  timer 
)

Instantiates servo object by setting enable pin to high and creating timer/timer channel objects for PWM control.

Parameters
en_pinis the enable pin for the servo motor
pwm_pinis the PWM pin used on Nucleo to send signal
timeris the timer number used corresponding to PWM pin

The documentation for this class was generated from the following file: