Kei Ohta / Mbed 2 deprecated DualMotor_TA7291P

Dependencies:   Motor mbed

Fork of DualMotor by Kei Ohta

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 /*
00002 TA7291P
00003 1 - GND
00004 2 - OutPut1
00005 3 - NonConnection
00006 4 - Vref(PwmOut)
00007 5 - IN1 (DigitalOut)
00008 6 - IN2 (DigitalOut)
00009 7 - VU 5V from mbed
00010 8 - MotorPower(+) 
00011 9 - NonConnection
00012 10 - OutPut2
00013 
00014 H-Bridge Circuit
00015 1-0 ClockWise
00016 0-1 CounterClockWise
00017 */
00018 
00019 #include "mbed.h"
00020 #include "Motor.h"
00021 
00022 Motor m1(p21, p5, p6); // pwm, fwd, rev
00023 Motor m2(p23, p7, p8);    // pwm, fwd, rev
00024 Serial pc(USBTX,USBRX);
00025 
00026 int main() {
00027     while(1) {
00028 //        pc.printf("motorOFF\r\n");
00029         m1.speed(0.0f);
00030         m2.speed(-1.0f);
00031         wait(5.0);
00032 //        pc.printf("motorON\r\n");
00033         m1.speed(1.0f);
00034         m2.speed(0.0f);
00035         wait(1.0);
00036     }
00037 }