gyo

SBDBT.h

Committer:
nanjo
Date:
2019-02-16
Revision:
9:8538fc8f6259
Parent:
8:f3e2b37e206f
Child:
12:f7eb7dfa1356

File content as of revision 9:8538fc8f6259:

#ifndef INCLDUED_SBDBT_h_
#define INCLDUED_SBDBT_h_
#include "mbed.h"

//data[1]
#define SHIKAKU_    0x01
#define L1_         0x02
#define L2_         0x04
#define L3_         0x08
#define R1_         0x10
#define R2_         0x20
#define R3_         0x40

//data[2]
#define UE_         0x01
#define SITA_       0x02
#define MIGI_       0x04
#define HIDARI_     0x08
#define SANKAKU_    0x10
#define BATU_       0x20
#define MARU_       0x40
#define START_      3
#define SELECT_     12


    class SBDBT
    {
        private:
        char i;
        char length;
        char value;
        char position;
        char *tmp;
        Serial *sr;
        
        public:
        char readable;
        char *data;
        char *data_p;
        SBDBT(PinName, PinName);
        SBDBT(PinName, PinName, int);
        void getf();
        void print();
        int8_t State_check();
        void check();
        char CIRCLE;
        char CROSS;
        char SQUARE;
        char TRIANGLE;
        char L1;
        char L2;
        char L3;
        char R1;
        char R2;
        char R3;
        char UPkey;
        char DOWNkey;
        char RIGHTkey;
        char LEFTkey;
        signed char RX;
        signed char RY;
        signed char LX;
        signed char LY;
        char rs_x_check();
        char rs_y_check();
        char ls_x_check();
        char ls_y_check();
        ~SBDBT();
    };
    

#endif