Skip to content

Instantly share code, notes, and snippets.

@TheCuttlefish
Created April 1, 2025 21:36
Show Gist options
  • Save TheCuttlefish/7c4bee3c2b2d6e0ebbb3d5669ed40e82 to your computer and use it in GitHub Desktop.
Save TheCuttlefish/7c4bee3c2b2d6e0ebbb3d5669ed40e82 to your computer and use it in GitHub Desktop.
tilt to keys makey makey + BBC micro (slow)
basic.forever(function () {
let roll = input.rotation(Rotation.Roll) // Left/right tilt
if (roll < -20) {
makeyMakey.typeKey(makeyMakey.KeyPress.A)
basic.showArrow(ArrowNames.West)
} else if (roll > 20) {
makeyMakey.typeKey(makeyMakey.KeyPress.D)
basic.showArrow(ArrowNames.East)
} else {
basic.clearScreen()
}
basic.pause(0) // Repeat speed — 100ms = 10 key presses/sec
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment