tools lessons (#1218)

* tools lessons

* updated summary

* more images

* wire up images

* fixing radio send-value
This commit is contained in:
Peli de Halleux
2018-09-12 13:26:39 -07:00
committed by GitHub
parent 5dde6947d3
commit d0a40d1ae1
11 changed files with 51 additions and 26 deletions

View File

@ -1,18 +0,0 @@
# Plot Analog Pin
Use this program to graph the analog value on pin ``P0``, ``P1`` or ``P2``.
Press ``A`` to scroll the value on the screen.
```blocks
let reading = 0
basic.forever(() => {
reading = pins.analogReadPin(AnalogPin.P0)
led.plotBarGraph(
reading,
1023
)
if (input.buttonIsPressed(Button.A)) {
basic.showNumber(reading)
}
})
```

View File

@ -1,26 +0,0 @@
# Servo calibrator
Use this program to calibrate the angles of a servo.
Press ``A`` to reduce the angle by 5 and ``B`` to
increase it by 5.
The current angle is displayed on the screen
in a loop.
```blocks
let angle = 90
input.onButtonPressed(Button.A, () => {
angle -= Math.max(0, 5)
pins.servoWritePin(AnalogPin.P0, angle)
led.stopAnimation()
})
input.onButtonPressed(Button.B, () => {
angle += Math.min(180, 5)
pins.servoWritePin(AnalogPin.P0, angle)
led.stopAnimation()
})
basic.forever(() => {
basic.showNumber(angle)
})
pins.servoWritePin(AnalogPin.P0, angle)
```