Dependencies:   PWM-Coil-driver

Fork of InjectorValveFourthMicro1 by Ian Wolf

Files at this revision

API Documentation at this revision

Comitter:
iwolf32
Date:
Thu Sep 07 20:56:19 2017 +0000
Parent:
3:0f441a513e2c
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 0f441a513e2c -r ffadadb4c946 main.cpp
--- a/main.cpp	Thu Sep 07 20:31:32 2017 +0000
+++ b/main.cpp	Thu Sep 07 20:56:19 2017 +0000
@@ -25,9 +25,11 @@
   
     
     while(1){
-        openvalue=(((1/frequency)*dutycycle/100));
+        str.clear();
+        openvalue=(((1/frequency)*(dutycycle/100)));
         offvalue=(1/frequency)-openvalue;
-        if (dutycycle!=0){        
+        if (dutycycle!=0){
+        str.clear();        
         injector.on();
         wait(openvalue);
         injector.off();