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: Motor_Driver_V2 mbed
main.cpp
- Committer:
- alienbernamaihsan
- Date:
- 2019-01-27
- Revision:
- 0:667eb2a74dbf
File content as of revision 0:667eb2a74dbf:
#include "mbed.h"
#include "motor.h"
//format : PWM, pin digital (buat nentuin arah)
motor motor1 (PA_9, PA_8);
motor motor2 (PA_7, PC_7);
motor motor3 (PA_5, PC_8);
// Serial
Serial pc(USBTX,USBRX,115200);
int main()
{
while(1)
{
motor1.setpwm(0.3);
motor2.setpwm(0.3);
motor3.setpwm(0.3);
wait(3);
motor1.setpwm(-0.3);
motor2.setpwm(-0.3);
motor3.setpwm(-0.3);
wait(3);
}
}