Created
April 1, 2025 21:36
-
-
Save TheCuttlefish/7c4bee3c2b2d6e0ebbb3d5669ed40e82 to your computer and use it in GitHub Desktop.
tilt to keys makey makey + BBC micro (slow)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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