.

Dependents:   Konstrukcijski_Blazevic kontrola_ulaza_IF

Files at this revision

API Documentation at this revision

Comitter:
ifluka
Date:
Fri May 07 08:44:05 2021 +0000
Parent:
0:b3bc716e5bea
Commit message:
a

Changed in this revision

Ledica.cpp Show annotated file Show diff for this revision Revisions of this file
Ledica.h Show annotated file Show diff for this revision Revisions of this file
--- a/Ledica.cpp	Tue Apr 06 12:07:11 2021 +0000
+++ b/Ledica.cpp	Fri May 07 08:44:05 2021 +0000
@@ -1,14 +1,13 @@
 #include "Ledica.h"
 #include "mbed.h"
+Indicator::Indicator(PinName lightPin) : light(lightPin) {
+    
+}
 
-Ledica::Ledica(PinName pin) : _pin(pin){
-    _pin = 0;
-    }
+void Indicator::light_on(int t, int v1, int v2) {
     
-void Ledica::status(int status){
-    _pin = status;
-    }
-void Ledica::flipp(){
-    _pin = !_pin;
-    }
-    
\ No newline at end of file
+    if(t>=v1 && t<v2)
+    light=1;
+    wait(0.00001);
+    light=0;
+}
--- a/Ledica.h	Tue Apr 06 12:07:11 2021 +0000
+++ b/Ledica.h	Fri May 07 08:44:05 2021 +0000
@@ -1,13 +1,13 @@
-#ifndef MBED_LEDICA_H
-#define MBED_LEDICA_H
+#ifndef ledica_h
+#define ledica_h
 #include "mbed.h"
-
-class Ledica{
-    public:
-     Ledica(PinName pin);
-     void status(int status);
-     void flipp();
-    private:
-     DigitalOut _pin;
-    };
+class Indicator{
+public:
+    Indicator(PinName light);
+    void light_on(int t, int v, int n);
+    
+private:
+    DigitalOut light;
+    
+};
 #endif
\ No newline at end of file