PS3の移動ライブラリ(バグあり動作不可)です。 誠意製作中です。

Dependents:   NHK2018_BM

PS3_S.h

Committer:
tektomo
Date:
2018-09-27
Revision:
2:9b3aeecc67d9
Parent:
0:1e79ec3fb922

File content as of revision 2:9b3aeecc67d9:

#ifndef PS3S_h
#define PS3S_h
/*PS3 button Code(8 byte) And Array number
First bit value of all code is 0x80(128)
0  Up:      0x00,0x01,0x40,0x40,0x40,0x40,0x01(0,1,64,64,64,64,1)
1  Down:    0x00,0x02,0x40,0x40,0x40,0x40,0x02(0,2,64,64,64,64,2)
2  Right:   0x00,0x04,0x40,0x40,0x40,0x40,0x04(0,4,64,64,64,64,4)
3  Left:    0x00,0x08,0x40,0x40,0x40,0x40,0x08(0,8,64,64,64,64,8)
4  Triangle:0x00,0x10,0x40,0x40,0x40,0x40,0x10(0,10,64,64,64,64,10)
5  X:       0x00,0x20,0x40,0x40,0x40,0x40,0x20(0,32,64,64,64,64,32)
6  Circle:  0x00,0x40,0x40,0x40,0x40,0x40,0x40(0,64,64,64,64,64,64)
7  Box:     0x01,0x00,0x40,0x40,0x40,0x40,0x01(1,0,64,64,64,64,1)
8  L1:      0x02,0x00,0x40,0x40,0x40,0x40,0x02(2,0,64,64,64,64,2)
9  L2:      0x04,0x00,0x40,0x40,0x40,0x40,0x04(4,0,64,64,64,64,4)
10 R1:      0x08,0x00,0x40,0x40,0x40,0x40,0x08(8,0,64,64,64,64,8)
11 R2:      0x10,0x00,0x40,0x40,0x40,0x40,0x10(16,0,64,64,64,64,16)
12 Select:  0x00,0x0C,0x40,0x40,0x40,0x40,0x0C(0,12,64,64,64,64,12)
13 Start:   0x00,0x03,0x40,0x40,0x40,0x40,0x03(0,3,64,64,64,64,3)
14 LX       0 - 127 1byte
15 LY       0 - 53 Up and Left
16 RX       75 - 127 Down and Right
17 RY       54 - 64 - 74 Neutral
End comment*/

#include "mbed.h"
class PS3s : public Serial{
    public: 
    PS3s(PinName TX, PinName RX); /*: Serial(TX, RX){*/
    int condata[18];
    int Rdata[8];
    int button1_buffer;
    int button2_buffer;
    int dataval;
    
void getdata();
void checkdata();
};
#endif