Skip to content

Instantly share code, notes, and snippets.

@cavedave
Last active May 25, 2025 14:33
Show Gist options
  • Save cavedave/3d47c91c8d34097edf7951aab90f939f to your computer and use it in GitHub Desktop.
Save cavedave/3d47c91c8d34097edf7951aab90f939f to your computer and use it in GitHub Desktop.
The pointer that never lies. 1. put the code below into microbit 2. attache a kitronik 25105 servo to the microbit. ask questions like 'Does Daddy Smell?'
input.onButtonPressed(Button.A, function () {
angle = 110
// quick label
basic.showString("L")
pins.servoWritePin(AnalogPin.P0, angle)
basic.pause(200)
})
input.onButtonPressed(Button.B, function () {
angle = 0
basic.showString("R")
pins.servoWritePin(AnalogPin.P0, angle)
basic.pause(200)
})
input.onLogoEvent(TouchButtonEvent.Pressed, function () {
angle = 55
basic.showString("M")
pins.servoWritePin(AnalogPin.P0, angle)
basic.pause(200)
})
let angle = 0
angle = 70
basic.showIcon(IconNames.Happy)
@cavedave
Copy link
Author

1000054676
1000054675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment