Created
December 26, 2012 19:09
-
-
Save dheaney/4382322 to your computer and use it in GitHub Desktop.
Joystick "Top Hat" logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "JoystickDriver.c" | |
task main() { | |
while(true) { | |
if( joystick.joy1_TopHat == 0 ) { | |
// top button pressed | |
} | |
if( joystick.joy1_TopHat == 2 ) { | |
//right button pressed | |
} | |
if( joystick.joy1_TopHat == 4 ) { | |
//bottom button pressed | |
} | |
if( joystick.joy1_TopHat == 6 ) { | |
//left button pressed | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment