gamepad遥控手柄扩展板

from microbit import *
import gamePad

gamePad=gamePad()

while True:
    if(gamePad.UP_pressed()):
        display.show(Image.CLOCK12)
    elif(gamePad.DOWN_pressed()):
        display.show(Image.CLOCK6)
    elif(gamePad.LEFT_pressed()):
        display.show(Image.CLOCK9)
    elif(gamePad.RIGHT_pressed()):
        display.show(Image.CLOCK3)
    elif(gamePad.XPAD_pressed()):
        display.show("X")
    elif(gamePad.YPAD_pressed()):
        display.show("Y")
    else:
        display.clear()

此代码针对GamePad遥控手柄扩展板: