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: mbed QEI HIDScope biquadFilter MODSERIAL FastPWM
main.cpp
- Committer:
- joostbonekamp
- Date:
- 2019-10-02
- Revision:
- 2:bbaa6fca2ab1
- Parent:
- 1:b862262a9d14
- Child:
- 3:e3d12393adb1
File content as of revision 2:bbaa6fca2ab1:
#include "mbed.h"
#include "MODSERIAL.h"
#include "FastPWM.h"
#include "QEI.h"
DigitalOut motor2_direction(D4);
PwmOut motor2_pwm(D5);
int main() {
while (true) {
motor2_direction = 1;
for (float i = 0; i < 1; i+=0.01) {
motor2_pwm = i;
wait(0.1);
}
motor2_direction = 0;
for (float i = 0; i < 1; i+=0.01) {
motor2_pwm = i;
wait(0.1);
}
}
}