Hardware Reference
In-Depth Information
Figure 14-12:
he complete
joystick button
controller.
Listing 14-2 Testing the Joystick Buttons
#!/usr/bin/env python
“””
Joystick button tester on the PiFace board
“””
import piface.pfio as pfio # piface library
pfio.init() # initialise pfio
positions = [“nothing”, “north (blue)”, “west (yellow)”, ;
“north west”, “east (red)”,”north east”,”east & west??”, ;
“big north”, “south (green)”, “north & south??”, “south ;
west”, “big west”, “south east”, “big east”, “big south”, ;
“all on”]
def main():
lastInput =0
 
Search WWH ::




Custom Search