Milk Jar Robot (#377)

* first draft

* fixed code section

* calibration

* fix broken link
This commit is contained in:
Peli de Halleux
2017-03-26 21:22:40 -07:00
committed by GitHub
parent 3f25c2a170
commit 2bec29bdd1
12 changed files with 242 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# Servo calibrator
```blocks
let angle = 90
input.onButtonPressed(Button.A, () => {
angle -= 5
pins.servoWritePin(AnalogPin.P0, angle)
led.stopAnimation()
})
input.onButtonPressed(Button.B, () => {
angle += 5
pins.servoWritePin(AnalogPin.P0, angle)
led.stopAnimation()
})
basic.forever(() => {
basic.showNumber(angle)
})
pins.servoWritePin(AnalogPin.P0, angle)
basic.showString("Press A or B to change servo angle")
```