Digistump Forums

The Digispark => Digispark Libraries => Topic started by: ricardojlrufino on October 28, 2014, 10:01:30 pm

Title: Joystick Library - Increasing number of buttons !?
Post by: ricardojlrufino on October 28, 2014, 10:01:30 pm
I wonder how do I increase the number of buttons, I need 32.
I tried to move on DigiJoystick.h gcn64_usbHidReportDescriptor, but I could not work.

A library is like this:
https://www.pjrc.com/teensy/td_joystick.html

thanks
Title: Re: Joystick Library - Increasing number of buttons !?
Post by: ricardojlrufino on October 28, 2014, 10:04:52 pm
Code: [Select]
Please add this method

void setButtons(unsigned long buttons) {
last_built_report[8] = (int)((buttons >> 8) & 0XFF);
last_built_report[9] = (int)((buttons & 0XFF)); 
}

/*
        for 32
void setButtons(unsigned long buttons) {
// last_built_report[6] = (int)((buttons >> 24) & 0xFF);
// last_built_report[7] = (int)((buttons >> 16) & 0xFF);
// last_built_report[8] = (int)((buttons >> 8) & 0XFF);
// last_built_report[9] = (int)((buttons & 0XFF)); 
}*/
Title: Re: Joystick Library - Increasing number of buttons !?
Post by: mybook4 on November 12, 2014, 04:11:05 am
Did this work?  Were you able to increase the number of buttons to 32?