【初心者】スレを立てる前にココで質問を【Part27】 [転載禁止]©5ch.net
■ このスレッドは過去ログ倉庫に格納されています
0045名前は開発中のものです。
2015/01/13(火) 17:35:56.93ID:YBEoghGf/*** Create the data packet that holds the entire position info ***/
// Set the device ID
id = (BYTE)iInterface;
iReport.bDevice = id;
// Set values in four axes (Leave the rest in default state)
iReport.wAxisX=X;iReport.wAxisY=Y;iReport.wAxisZ=Z;iReport.wAxisZRot=ZR;
// Set buttons one by one
iReport.lButtons = 1<<count/20;
if (ContinuousPOV){
// Make Continuous POV Hat spin
iReport.bHats = (DWORD)(count*70);
iReport.bHatsEx1 = (DWORD)(count*70)+3000;
iReport.bHatsEx2 = (DWORD)(count*70)+5000;
iReport.bHatsEx3 = 15000 - (DWORD)(count*70);
if ((count*70) > 36000){
iReport.bHats = -1; // Neutral state
iReport.bHatsEx1 = -1; // Neutral state
iReport.bHatsEx2 = -1; // Neutral state
iReport.bHatsEx3 = -1; // Neutral state
};
}else{
// Make 5-position POV Hat spin
unsigned char pov[4];
pov[0] = ((count/20) + 0)%4;pov[1] = ((count/20) + 1)%4;
pov[2] = ((count/20) + 2)%4;pov[3] = ((count/20) + 3)%4;
iReport.bHats = (pov[3]<<12) | (pov[2]<<8) | (pov[1]<<4) | pov[if ((count) > 550)
iReport.bHats = -1; // Neutral state
};
■ このスレッドは過去ログ倉庫に格納されています