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 L298 by
Revision 0:f3cd2e9ab89b, committed 2016-06-20
- Comitter:
- satelite
- Date:
- Mon Jun 20 05:18:43 2016 +0000
- Child:
- 1:c83539e7f8a0
- Commit message:
- Ejemplo L298
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Mon Jun 20 05:18:43 2016 +0000
@@ -0,0 +1,25 @@
+#include "mbed.h"
+
+DigitalOut in1(PTC3);
+DigitalOut in2(PTC2);
+PwmOut ena(PTA2);
+
+int main()
+{
+ while (true) {
+ // Detiene el motor
+ in1 = 0;
+ in2 = 0;
+ wait(0.5f);
+ // Gira en sentido 1 con velocidad 50%
+ in1 = 1;
+ in2 = 0;
+ ena.write(0.50f);
+ wait(0.5f);
+ // Gira en sentido 2 con velocidad 100%
+ in1 = 0;
+ in2 = 1;
+ ena.write(1.00f);
+ wait(0.5f);
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Jun 20 05:18:43 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file
