Differences

This shows you the differences between two versions of the page.

Link to this comparison view

kuckucksmuehle:events:magneticforce [2018/07/23 14:19] (current)
julius_kingsman created
Line 1: Line 1:
 +====== 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:19
  • by julius_kingsman