ps3 with sbdbt
Dependents: hairobo2021_F446re
Revision 4:0fdf068ce9f4, committed 2021-11-26
- Comitter:
- st17099ng
- Date:
- Fri Nov 26 00:29:07 2021 +0000
- Parent:
- 3:5640aae53391
- Commit message:
- First commit
Changed in this revision
PS3.cpp | Show annotated file Show diff for this revision Revisions of this file |
PS3.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r 5640aae53391 -r 0fdf068ce9f4 PS3.cpp --- a/PS3.cpp Fri Sep 30 12:28:35 2016 +0000 +++ b/PS3.cpp Fri Nov 26 00:29:07 2021 +0000 @@ -11,7 +11,7 @@ PS3Data[6] = 64; PS3Data[7] = 0; addflag = 0; - baud(2400); + baud(115200); Serial::attach(this, &PS3::getdata, Serial::RxIrq); } void PS3::getdata() @@ -88,6 +88,3 @@ pc.printf("%4d", PS3Data[i]); } } - - -
diff -r 5640aae53391 -r 0fdf068ce9f4 PS3.h --- a/PS3.h Fri Sep 30 12:28:35 2016 +0000 +++ b/PS3.h Fri Nov 26 00:29:07 2021 +0000 @@ -1,7 +1,7 @@ #ifndef PS3_H #define PS3_H #include "mbed.h" - //bit,button +//bit,button #define sikaku 16 //00010000 #define sankaku 36 //00100100 #define batu 37 //00100101 @@ -19,7 +19,7 @@ class PS3 : public Serial { - public: +public: PS3(PinName TX, PinName RX);/* : Serial(TX,RX) { PS3Data[0] = 128; @@ -63,7 +63,7 @@ return atan2(double(PS3Data[4]*-1+64), double(PS3Data[3]-64))*double(180/PI); }*/ void printdata(); - private: +private: char PS3Data[8]; void (*fpFunc)(); bool addflag;