from microbit import *
import radio

radio.on()

while True:
  command = '.'
  if accelerometer.is_gesture("up"):
    if button_a.is_pressed() and button_b.is_pressed():
      command = 'B'
    elif button_a.is_pressed():
      command = 'K'
    elif button_b.is_pressed():
      command = 'Q'
  else:
    if button_a.is_pressed() and button_b.is_pressed():
      command = 'F'
    elif button_a.is_pressed():
      command = 'L'
    elif button_b.is_pressed():
      command = 'R'
  if command:
    display.show(command)
    radio.send(command)
  sleep(10)