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.
quadv3/pwmout.h
- Committer:
- Anaesthetix
- Date:
- 2013-01-30
- Revision:
- 0:978110f7f027
File content as of revision 0:978110f7f027:
#ifndef PWMOUT_H
#define PWMOUT_H
#include "mbed.h"
PwmOut motor1(p24);
PwmOut motor2(p23);
PwmOut motor3(p22);
PwmOut motor4(p21);
void startpwm(void);
void setpwm(signed int, signed int, signed int, signed int);
void startpwm() {
motor1.period_ms(5);
// motor2.period_ms(15);
// motor3.period_ms(15);
// motor4.period_ms(15);
motor1.pulsewidth_us(1200);
motor2.pulsewidth_us(1200);
motor3.pulsewidth_us(1200);
motor4.pulsewidth_us(1200);
}
void setpwm(signed int pwm1, signed int pwm2, signed int pwm3, signed int pwm4) {
motor1.pulsewidth_us(pwm1);
motor2.pulsewidth_us(pwm2);
motor3.pulsewidth_us(pwm3);
motor4.pulsewidth_us(pwm4);
}
#endif