Skip to content

Instantly share code, notes, and snippets.

@toyowata
Created September 30, 2018 01:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save toyowata/c24b3d6a38d16016827a8b5713fc3e10 to your computer and use it in GitHub Desktop.
let last_value = 0
let 傾き = 0
let rainbow: neopixel.Strip = null
rainbow = neopixel.create(DigitalPin.P0, 30, NeoPixelMode.RGB)
rainbow.showRainbow(1, 360)
last_value = 0
basic.forever(() => {
傾き = input.rotation(Rotation.Pitch)
if (last_value != 傾き) {
rainbow.rotate(傾き)
}
last_value = 傾き
rainbow.show()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment