Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Calliope coding magneticForce+set brightness ====== 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) kuckucksmuehle/events/magneticforce.txt Last modified: 2018/07/23 14:19by julius_kingsman