Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: TS_DISCO_F746NG mbed BufferedSerial LCD_DISCO_F746NG mbed-rtos Trigo BSP_DISCO_F746NG
Motor.cpp
- Committer:
- Carminio
- Date:
- 2016-11-28
- Revision:
- 7:d51b8b7f9960
- Parent:
- 0:88706d6abbf7
- Child:
- 8:7788cc96e8ad
File content as of revision 7:d51b8b7f9960:
#include "mbed.h"
#include "Motor.h"
void Motor::StartMotor_Scan()
{
uint8_t period=40; //Frequency 25KHz
uint8_t pulsewidth=32; //Duty cycle 80%
period_us(period);
pulsewidth_us(pulsewidth);
}
void Motor::StopMotor_Scan()
{
uint8_t period=40; //Frequency 0Hz
uint8_t pulsewidth=0; //Duty cycle 0%
period_us(period);
pulsewidth_us(pulsewidth);
}