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.
Fork of DualMotor by
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 }
Generated on Wed Jul 13 2022 04:39:08 by
1.7.2
