let magneticForce = 0 let rotation = 0 input.onButtonPressed(Button.A, () ⇒ {
while (!(input.buttonIsPressed(Button.B))) { magneticForce = input.magneticForce(Dimension.X) // magneticForce : 25 - -25 basic.showLeds(` # # # # # # # # # # # # # # # # # # # # # # # # # `) //if (magneticForce >= 0) { // led.setBrightness(10) //} else { // led.setBrightness(210) //} }
}) rotation = 0
led.setBrightness(magneticForce * 10)