Dependents:   InjectorValveFourthMicro InjectorValveFourthMicro1 InjectorValveFourthMicro2 ReadingInLines_copy

Fork of PWM-Coil-driver by David Wahl

Files at this revision

API Documentation at this revision

Comitter:
iwolf32
Date:
Tue Sep 05 19:34:02 2017 +0000
Parent:
6:e8395448fc8b
Commit message:

Changed in this revision

coil-driver.cpp Show annotated file Show diff for this revision Revisions of this file
coil-driver.h Show annotated file Show diff for this revision Revisions of this file
--- a/coil-driver.cpp	Thu Jul 20 20:33:16 2017 +0000
+++ b/coil-driver.cpp	Tue Sep 05 19:34:02 2017 +0000
@@ -1,27 +1,3 @@
-// Begin sample code
-/*
-#include "mbed.h"
-#include "rtos.h"
-#include "coil-driver.h"
-// Coil parameters [control pin, spike time (us), hold time period (us), hold time pulse width (us)]
-Coil orange(A0, 500, 40, 3); // Valve driven by pin A0, 500us spike time, 25kHz PWM at 7.5% duty cycle
-
-Coil yellow(A1, 5000, 40, 6); // Valve driven by pin A1, 5ms spike time, 25kHz PWM at 15% duty cycle
-
-int main()
-{
-    while (true) {
-        orange.on();
-        yellow.on();
-        Thread::wait(500);
-        orange.off();
-        yellow.off();
-        Thread::wait(500);
-    }
-}
-*/
-// End sample code
-
 #include "coil-driver.h"
 
 // Default constructor
--- a/coil-driver.h	Thu Jul 20 20:33:16 2017 +0000
+++ b/coil-driver.h	Tue Sep 05 19:34:02 2017 +0000
@@ -1,9 +1,8 @@
+#include "mbed.h"
+
 #ifndef COIL_DRIVER_H
 #define COIL_DRIVER_H
 
-#include "mbed.h"
-#include "rtos.h"
-
 // Coil driver class. Applies full power for given "spike" time
 // and then applies a PWM signal to keep the coil energized at a lower power.
 class Coil
@@ -20,4 +19,5 @@
     void off();
 };
 
+
 #endif
\ No newline at end of file