little rework on the print function ^^

little optimization of the print() function would be something like this :

int joy_x_axis = outbuf[0];
int joy_y_axis = outbuf[1];
int accel_x_axis = (outbuf[2] << 2) + ((outbuf[5] >> 2) & 0x03);
int accel_y_axis = (outbuf[3] << 2) + ((outbuf[5] >> 4) & 0x03);
int accel_z_axis = (outbuf[4] << 2) + ((outbuf[5] >> 6) & 0x03);
int z_button = outbuf[5] & 1;
int c_button = outbuf[5] & 2;

geting a nunchuck tomorrow and write some plain avrlibc examples :D

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Captcha
This question is used to make sure you are a human visitor and to prevent spam submissions.
Copy the characters (respecting upper/lower case) from the image.