Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: tipkalo.h
- Revision:
- 3:b9ab9a191011
- Parent:
- 0:9624782a02b3
diff -r fa666d2759a4 -r b9ab9a191011 tipkalo.h
--- a/tipkalo.h Sun Jan 29 23:47:12 2017 +0000
+++ b/tipkalo.h Wed Nov 22 08:51:34 2017 +0000
@@ -1,29 +1,38 @@
#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();
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