Tipkalo Linija

Dependents:   Lilnija_29012017

Revision:
2:9085093855f0
Parent:
0:9624782a02b3
diff -r fa666d2759a4 -r 9085093855f0 tipkalo.h
--- a/tipkalo.h	Sun Jan 29 23:47:12 2017 +0000
+++ b/tipkalo.h	Wed Feb 08 08:36:23 2017 +0000
@@ -1,29 +1,39 @@
 #ifndef TIPKALO_H
 #define TIPKALO_H
+#ifndef MBED_H
+#include "mbed.h"
+#endif 
+#ifndef GLOBAL_NAZIVI_H
+#include "global_nazivi.h"
+#endif
 
-#define t_milisec_pritisnut = 200;
+#define t_milisec_pritisnut 50
 
 typedef enum {
     TDOLJE = 1, TGORE = 0, TNEZNAM = -1
-};
+} TTipkalo;
 
 typedef struct t_status {
-    int radim;                // tukljucen ili tiskljucen
-    int pritisnut;
-} t_status;
+    TTipkalo pritisnut;            // debounce
+} TStatus;
 
 
 //---------------TIPKALO------------------//
 class Tipkalo {
     public:
-        Tipkalo(PinName T);
-        t_status tDolje();
+        Tipkalo();
+        void bStart();
+        void blinkFall();
+        void togglerOff();
+        void blinkRise();
+        void bStop();
+        bool LStatus();
     private:
-        InterruptIn _T;
-        int _countT;
+        DigitalOut ledSec;
+        InterruptIn pbutton;
+        Ticker toggler;
+        Timeout detachToggler;
+        Timer t;
 };
 
-//-----------TIPKALO JOYSTICK-------------//
-// To je zapravo TIPKALO
-
 #endif /* TIPKALO_H */
\ No newline at end of file