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.
Diff: include/EngineDriver.h
- Revision:
- 1:90d75436758b
- Child:
- 2:09cc6b203fe4
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/EngineDriver.h Mon Jun 22 15:47:43 2015 +0000
@@ -0,0 +1,53 @@
+#ifndef DRIVER_H
+#define DRIVER_H
+#include "mbed.h"
+DigitalOut en1(D2);
+DigitalOut en2(D4);
+DigitalOut in1(D3);
+DigitalOut in2(D5);
+DigitalOut in3(D6);
+DigitalOut in4(D10);
+void testEngines()
+{
+ in1 = 1;
+ in2 = 0;
+ in3 = 1;
+ in4 = 0;
+ wait(1);
+ in1 = 0;
+ in2 = 1;
+ in3 = 0;
+ in4 = 1;
+ wait(1);
+}
+void enableAll()
+{
+ en1 = 1;
+ en2 = 1;
+}
+void enableOne(int which)
+{
+ if(which == 0)
+ {
+ en1 = 1;
+ }else if(which == 1)
+ {
+ en2 = 1;
+ }
+}
+void disableAll()
+{
+ en1 = 0;
+ en2 = 0;
+}
+void disableOne(int which)
+{
+ if(which == 0)
+ {
+ en1 = 0;
+ }else if(which == 1)
+ {
+ en2 = 0;
+ }
+}
+#endif //DRIVER_H
\ No newline at end of file