-
-
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?'
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
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) |
Author
cavedave
commented
May 25, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment