Aktivacija LED u slučaju zaustavljenog rada.

Dependents:   Detektor_Pokreta Dino_Martic_Programski

Files at this revision

API Documentation at this revision

Comitter:
dmartic
Date:
Mon Jan 20 13:00:31 2020 +0000
Commit message:
Prva verzija detektora pokreta za LPC1768 MBed + TinyRTC DS1307 i PIR detektorom pokreta.

Changed in this revision

DetectOff.cpp Show annotated file Show diff for this revision Revisions of this file
DetectOff.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DetectOff.cpp	Mon Jan 20 13:00:31 2020 +0000
@@ -0,0 +1,16 @@
+//Izvorne datoteke
+#include "DetectOff.h"
+#include "mbed.h"
+
+//Inicijalizacija funkcije i varijable
+DetectOff::DetectOff(PinName pin): _pin(pin){
+    _pin = 0;
+    }
+
+//Funkcija za flip
+void DetectOff::disable(int n){
+        for(int i=0;i<n*2;i++){
+            _pin = !_pin;
+            wait(0.2);
+            }
+    }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DetectOff.h	Mon Jan 20 13:00:31 2020 +0000
@@ -0,0 +1,20 @@
+#ifndef MBED_DETECTOFF_H
+#define MBED_DETECTOFF_H
+
+//Izvorne datoteke
+#include "mbed.h"
+
+
+//Definicija klase
+class DetectOff{
+    //Javne varijable
+    public:
+        DetectOff(PinName pin);
+        void disable(int n);
+    
+    //Privatne varijable
+    private:
+        DigitalOut _pin;
+    };
+    
+#endif
\ No newline at end of file