All you need for many hours of fun (compile with Allegro):
#include <allegro.h>
#include <stdio.h>
int joypos, spins;
void joyloop ()
{
poll_joystick ();
switch (joypos)
{
case 0: if (joy[0].stick[0].axis[0].d2 && joy[0].stick[0].axis[1].d1) joypos++; break;
case 1: if (joy[0].stick[0].axis[0].d2 && joy[0].stick[0].axis[1].d2) joypos++; break;
case 2: if (joy[0].stick[0].axis[0].d1 && joy[0].stick[0].axis[1].d2) joypos++; break;
case 3:
if (joy[0].stick[0].axis[0].d1 && joy[0].stick[0].axis[1].d1)
{
joypos = 0;
spins++;
}
}
}
int main ()
{
printf ("Spin the joystick as fast as you can!\n");
allegro_init ();
install_joystick (JOY_TYPE_AUTODETECT);
install_timer ();
joypos = spins = 0;
rest_callback (15000, joyloop);
printf ("You spun the joystick %d times!\n", spins);
return 0;
}
And there you have it - your own personal blister generator.