dc motor documentation
This commit is contained in:
parent
ea88a3601e
commit
c5f0beac0b
1 changed files with 17 additions and 1 deletions
|
@ -1,9 +1,25 @@
|
|||
/**
|
||||
******************************************************************************
|
||||
* @file DCMotor.h
|
||||
* @author CAVAILLES, Kevin and GÜLDENSTEIN, Jasper
|
||||
* @brief Service for setting the speed of a DC motor using a PWM signal.
|
||||
******************************************************************************
|
||||
*/
|
||||
#ifndef DC_MOTOR_H
|
||||
#define DC_MOTOR_H
|
||||
|
||||
/**
|
||||
* @brief Initialziation function for the DC_MOTOR module.
|
||||
* Peripherals used: TIM2
|
||||
* Pins used: PA1 (TIM2 channel 1, PWM Output)
|
||||
* PA2 (GPIO, direction control)
|
||||
*/
|
||||
void DC_MOTOR_Init(void);
|
||||
|
||||
// set a speed between -100 (full throttle clockwise) 0 (stop) and 100 (full throttle counterclockwise)
|
||||
/**
|
||||
* @brief Sets the speed of the DC motor using a PWM signal with a period of 50us -> frequency of 20kHz and a resolution of 0.5us
|
||||
* @param speed value between -100 (full throttle clockwise), 0 (stop), and 100 (full throttle counterclockwise)
|
||||
*/
|
||||
void DC_MOTOR_SetSpeed(int speed);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue