Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://www.codeproject.com/Articles/23634/Wired-PS-Six-Axis-Controller-Using-USB-HID-as-Inp
- typedef struct tagPS3_data
- {
- BYTE ReportID;
- union {
- struct{
- BYTE LAnalogX;
- BYTE LAnalogY;
- BYTE dummy[46];
- bool Triangle:1;
- bool Circle:1;
- bool Cross:1;
- bool Cube:1;
- bool L2:1;
- bool R2:1;
- bool L1:1;
- bool R1:1;
- };
- BYTE data[49];
- };
- } PS3_data;
- iPos += sprintf(&buffer[iPos],"test %d\r\n", 0 );
- void PS3_data::Format ( char* buffer )
- {
- int iPos = 0;
- iPos += sprintf(&buffer[iPos],"LeftJoy:%d-%d RightPad:%d %d %d %d\r\n",
- LAnalogX,LAnalogY,Triangle,Circle,Cross,Cube);
- int id=0;
- int idMax=45;
- for ( ; id<=idMax;id++) iPos += sprintf(&buffer[iPos],"%02d:%d\r\n", id,
- data[id]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement