tools lessons (#1218)
* tools lessons * updated summary * more images * wire up images * fixing radio send-value
This commit is contained in:
18
docs/projects/analog-pin-calibrator.md
Normal file
18
docs/projects/analog-pin-calibrator.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Analog Pin Calibrator
|
||||
|
||||
Use this program to graph the analog value on pin ``P0``.
|
||||
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)
|
||||
}
|
||||
})
|
||||
```
|
18
docs/projects/light-level-calibrator.md
Normal file
18
docs/projects/light-level-calibrator.md
Normal file
@ -0,0 +1,18 @@
|
||||
# Light level Calibrator
|
||||
|
||||
Use this program to graph the light level.
|
||||
Press ``A`` to scroll the value on the screen.
|
||||
|
||||
```blocks
|
||||
let reading = 0
|
||||
basic.forever(() => {
|
||||
reading = input.lightLevel()
|
||||
led.plotBarGraph(
|
||||
reading,
|
||||
255
|
||||
)
|
||||
if (input.buttonIsPressed(Button.A)) {
|
||||
basic.showNumber(reading)
|
||||
}
|
||||
})
|
||||
```
|
26
docs/projects/servo-calibrator.md
Normal file
26
docs/projects/servo-calibrator.md
Normal file
@ -0,0 +1,26 @@
|
||||
# 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, angle - 5)
|
||||
pins.servoWritePin(AnalogPin.P0, angle)
|
||||
led.stopAnimation()
|
||||
})
|
||||
input.onButtonPressed(Button.B, () => {
|
||||
angle = Math.min(180, angle + 5)
|
||||
pins.servoWritePin(AnalogPin.P0, angle)
|
||||
led.stopAnimation()
|
||||
})
|
||||
basic.forever(() => {
|
||||
basic.showNumber(angle)
|
||||
})
|
||||
pins.servoWritePin(AnalogPin.P0, angle)
|
||||
```
|
25
docs/projects/tools.md
Normal file
25
docs/projects/tools.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Tools
|
||||
|
||||
## Calibration
|
||||
|
||||
```codecard
|
||||
[{
|
||||
"name": "Light Level Calibrator",
|
||||
"description": "Calibrate light input",
|
||||
"url": "/projects/light-level-calibrator",
|
||||
"imageUrl": "/static/mb/projects/light-level-calibrator.png",
|
||||
"cardType": "side"
|
||||
}, {
|
||||
"name": "Analog Pin Calibrator",
|
||||
"description": "Calibrate analog input",
|
||||
"url": "/projects/analog-pin-calibrator",
|
||||
"imageUrl": "/static/mb/projects/analog-pin-calibrator.png",
|
||||
"cardType": "side"
|
||||
}, {
|
||||
"name": "Servo Calibrator",
|
||||
"description": "Calibrate a servo",
|
||||
"url": "/projects/servo-calibrator",
|
||||
"imageUrl": "/static/mb/projects/servo-calibrator.png",
|
||||
"cardType": "side"
|
||||
}]
|
||||
```
|
Reference in New Issue
Block a user