Lego EV3

motor [A] turn this way for (1) seconds
motor [D] turn that way for (1) seconds
motor [C] set power (1) %
ev3!motor [A] position
when button [4] pressed
when distance lt (50)
when brightness lt (5)
button [1] pressed?
ev3!distance
brightness
beep note (a) for (10) secs