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
Diff: main.cpp
- Revision:
- 0:594ca304c197
diff -r 000000000000 -r 594ca304c197 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Oct 13 02:07:07 2014 +0000 @@ -0,0 +1,39 @@ +#include "mbed.h" + +DigitalOut led(LED_RED); +DigitalIn Reverse (PTC6); //SW2 +//***********************************OUTL1, OUTL2****************************************************************** +PwmOut PWML (D5); //IN2 +DigitalOut ENDL (D4); //EN_D2 is logic LOW, the H-Bridge A is placed in Sleep Mode +//DigitalIn AD3 (D3); //FeedBack provides current sensing feedback of the H-Bridge high side drivers. A ground-referenced 0.24% of load current is output to this pin. + +//***********************************OUTR1, OUTR2****************************************************************** +PwmOut PWMR (D7); //IN2 +DigitalOut ENDR (D6); //EN_D2 is logic LOW, the H-Bridge B is placed in Sleep Mode. +//DigitalIn AD4 (D4); //FeedBack provides current sensing feedback of the H-Bridge high side drivers. A ground-referenced 0.24% of load current is output to this pin. + +//DigitalIn SF (A2); //StatusFlag, Active LOW + +int i; + +int main() +{ + PWML.period(0.0909); //11KHZ, 0.0909ms + PWMR.period(0.0909); + ENDL=1; + ENDR=1; //H-Bridges active + + while(1) { + + + for (i=0;i<5000;i=i+1) //5000 PWM cycles + { + PWML.write(i/5000); + PWMR.write(i/5000); + + wait(0.01); + } + } +} + +