doubt about nunchack standalone code

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
avazdo
Posts: 6
Joined: Thu Sep 01, 2011 12:55 pm

doubt about nunchack standalone code

Post by avazdo »

Hi everybody
I've just inserted a nunchuck in standalone mode into my quadcopter system and I don't understand something. (gyro is a ITG3200 WMP)
Why this code?

Code: Select all

#if defined(NUNCHACK)
.... .... ....
.... .... ....
  ACC_ORIENTATION(  ( (rawADC[3]<<2)        + ((rawADC[5]>>4)&0x2) ) ,
                  - ( (rawADC[2]<<2)        + ((rawADC[5]>>3)&0x2) ) ,
                    ( ((rawADC[4]&0xFE)<<2) + ((rawADC[5]>>5)&0x6) ));
  ACC_Common();
}
#endif

instead this other?

Code: Select all

#if defined(NUNCHACK)
.... .... ....
.... .... ....
  ACC_ORIENTATION(  ( (rawADC[3]<<2)        + ((rawADC[5]>>4)&0x3) ) ,
                  - ( (rawADC[2]<<2)        + ((rawADC[5]>>2)&0x3) ) ,
                    ( (rawADC[4]<<2)        + ((rawADC[5]>>6)&0x3) ));
  ACC_Common();
}
#endif

I was finding a answer through forums without success
I'm sorry. My English is bad.
Thanks a lot

Post Reply