Spiral Ray / Mbed 2 deprecated Nucleo_motor_LockedAntiphase

Dependencies:   Motor_LockedAntiphase mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "motor_lockedantiphase.h"
00003 
00004 PwmOut motora(PA_0);
00005 PwmOut motorb(PA_1);
00006 Motor_LockedAntiphase motor(motora,motorb);
00007 
00008 DigitalOut myled(LED1);
00009 
00010 int main() {
00011     
00012     motor.period_us(50);    //20kHz
00013     
00014     while(1) {
00015         myled =1;
00016         motor =1.0;
00017         wait(1);
00018         myled = 0;
00019         motor = 0;
00020         wait(1);
00021     }
00022 }