tes ir atas semua

Dependencies:   mbed ADS1115 StepperMotor SRF05 TPA81new

Revision:
12:1e3227a6fcd7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Uvtron/Uvtron.cpp	Sun Dec 16 01:53:07 2018 +0000
@@ -0,0 +1,51 @@
+#include "Uvtron.h"
+
+Uvtron::Uvtron(PinName a) : _a(a)
+{
+        Counter=0;
+        PrevCounter=0;
+        NextCounter=0;
+        Flag=0;
+        _a.mode(OpenDrain);
+        _a.rise(this, &Uvtron::Count);
+}
+
+void Uvtron::Count()
+{
+        Counter++;
+}
+
+void Uvtron::Read()
+{
+    
+        PrevCounter = NextCounter;
+        NextCounter = Counter;
+
+    
+    if(NextCounter>(PrevCounter+1)&&Flag==0)
+    {
+            Flag=1;
+            Counter=0;
+    }
+    else if (NextCounter==PrevCounter&&Flag==1)
+    {
+            Flag=0;
+    }
+}
+
+void Uvtron::UVScan()
+{
+        PrevCounter = NextCounter;
+        NextCounter = Counter;
+    
+        if((NextCounter>PrevCounter) && (FlagScan==0)){
+                        FlagScan = 1;
+                        Counter = 0;
+        }
+        else{
+                //FlagScan = 0;
+        }
+}
+
+
+