Za liniju

Dependents:   Lilnija_29012017

joystick.h

Committer:
mario_meh
Date:
2017-01-29
Revision:
0:bd9f3303564e
Child:
1:95b8a1055816
Child:
2:bdd4ee83ec25

File content as of revision 0:bd9f3303564e:

#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;
};