i i'm working on a mobile robot and i have a problem selecting joystick instead of other controls using procontroll library.
It is very simple; it provide a scanning of procontroll available peripheals fill an array with them and next you can choose joystick
there is only a problem...
it doesn't work
can someone help me ?
this is the sketch
It is very simple; it provide a scanning of procontroll available peripheals fill an array with them and next you can choose joystick
there is only a problem...
it doesn't work
can someone help me ?
this is the sketch
- //declare name
ControllIO controll;
//declare button name
ControllButton button0, button1, button2, button3, button4, button5, button6, button7;
//declare axis name
ControllSlider axisX, axisY, axisZ, rotoZ;
String[] JoyList = new String[0]; // declare an empty string for controls list
i=0;
while(i< controll.list().length)
{
JoyList = (append(JoyList, controll.list()[i]));
i++;
}
// print joystick list
StandardFont();
textAlign(LEFT);
text("Available Controls:",Z(800),Z(480));
for(i=0;i<(joyList.length);i++)
{
if (i == Joystick)
{
fill(0,100,255);
}
else
{
fill(255,255,255);
}
text(i + " = " + JoyList[i],Z(810),Z(500) + (i*20));
}
// takes joystick and check it
Joystick = RangeCheckInt(controll.getDevice(),0,JoyList.length);
....
joystick = new controll(this, Z(745), Z(558), controll.getDevice("joystick") 30);
3