Za liniju

Dependents:   Lilnija_29012017

Revision:
0:bd9f3303564e
Child:
1:95b8a1055816
Child:
2:bdd4ee83ec25
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/joystick.h	Sun Jan 29 23:48:12 2017 +0000
@@ -0,0 +1,34 @@
+#ifndef JOYSTICK_H
+#define JOYSTICK_H
+
+#ifndef MBED_H
+#include "mbed.h"
+#endif 
+#ifndef GLOBAL_NAZIVI_H
+#include "global_nazivi.h"
+#endif
+
+typedef enum {
+    Gore=0,Dolje=1,Lijevo=2,Desno=3, Odabir=4, NijeOdabir = 5,
+} Kompas;
+
+struct JoysKompas {
+    double horizontala;
+    double vertikala;
+    int jTipkalo;
+};
+
+class Joystick {
+    public:
+        Joystick();
+        // Podijelio joystick na dvije f-je os X i os Y
+        Kompas X();
+        Kompas Y();
+        Kompas tipka();
+        //
+        JoysKompas read();        
+    private:
+        int size;
+        AnalogIn _x;
+        AnalogIn _y;
+};
\ No newline at end of file