tools lessons (#1218)
* tools lessons * updated summary * more images * wire up images * fixing radio send-value
This commit is contained in:
parent
5dde6947d3
commit
d0a40d1ae1
@ -42,6 +42,9 @@
|
|||||||
* [Stop Watch](/projects/stopwatch)
|
* [Stop Watch](/projects/stopwatch)
|
||||||
* [Name Tag](/projects/name-tag)
|
* [Name Tag](/projects/name-tag)
|
||||||
* [Step counter](/projects/step-counter)
|
* [Step counter](/projects/step-counter)
|
||||||
|
* [Servo calibrator](/projects/servo-calibrator)
|
||||||
|
* [Analog Pin Calibrator](/projects/analog-pin-calibrator)
|
||||||
|
* [Light level calibrator](/projects/light-level-calibrator)
|
||||||
|
|
||||||
## #examples
|
## #examples
|
||||||
|
|
||||||
|
@ -43,16 +43,6 @@ Here are some fun programs for your @boardname@!
|
|||||||
"description": "Chart acceleration on the LED screen",
|
"description": "Chart acceleration on the LED screen",
|
||||||
"url": "/examples/plot-acceleration",
|
"url": "/examples/plot-acceleration",
|
||||||
"cardType": "example"
|
"cardType": "example"
|
||||||
}, {
|
|
||||||
"name": "Plot Light Level",
|
|
||||||
"description": "Chart light level on the LED screen",
|
|
||||||
"url": "/examples/plot-light-level",
|
|
||||||
"cardType": "example"
|
|
||||||
}, {
|
|
||||||
"name": "Plot Analog Pin",
|
|
||||||
"description": "Chart analog input on the LED screen",
|
|
||||||
"url": "/examples/plot-analog-pin",
|
|
||||||
"cardType": "example"
|
|
||||||
}, {
|
}, {
|
||||||
"name": "Radio Dashboard",
|
"name": "Radio Dashboard",
|
||||||
"description": "A dashboard for radio clients",
|
"description": "A dashboard for radio clients",
|
||||||
@ -60,14 +50,3 @@ Here are some fun programs for your @boardname@!
|
|||||||
"cardType": "example"
|
"cardType": "example"
|
||||||
}]
|
}]
|
||||||
```
|
```
|
||||||
|
|
||||||
## Actuators
|
|
||||||
|
|
||||||
```codecard
|
|
||||||
[{
|
|
||||||
"name": "Servo Calibrator",
|
|
||||||
"description": "Calibrate a servo",
|
|
||||||
"url": "/examples/servo-calibrator",
|
|
||||||
"cardType": "example"
|
|
||||||
}]
|
|
||||||
```
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Plot Analog Pin
|
# Analog Pin Calibrator
|
||||||
|
|
||||||
Use this program to graph the analog value on pin ``P0``, ``P1`` or ``P2``.
|
Use this program to graph the analog value on pin ``P0``.
|
||||||
Press ``A`` to scroll the value on the screen.
|
Press ``A`` to scroll the value on the screen.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
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)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
@ -10,12 +10,12 @@ in a loop.
|
|||||||
```blocks
|
```blocks
|
||||||
let angle = 90
|
let angle = 90
|
||||||
input.onButtonPressed(Button.A, () => {
|
input.onButtonPressed(Button.A, () => {
|
||||||
angle -= Math.max(0, 5)
|
angle = Math.max(0, angle - 5)
|
||||||
pins.servoWritePin(AnalogPin.P0, angle)
|
pins.servoWritePin(AnalogPin.P0, angle)
|
||||||
led.stopAnimation()
|
led.stopAnimation()
|
||||||
})
|
})
|
||||||
input.onButtonPressed(Button.B, () => {
|
input.onButtonPressed(Button.B, () => {
|
||||||
angle += Math.min(180, 5)
|
angle = Math.min(180, angle + 5)
|
||||||
pins.servoWritePin(AnalogPin.P0, angle)
|
pins.servoWritePin(AnalogPin.P0, angle)
|
||||||
led.stopAnimation()
|
led.stopAnimation()
|
||||||
})
|
})
|
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"
|
||||||
|
}]
|
||||||
|
```
|
@ -32,7 +32,6 @@ Then it shows them on the LED screen.
|
|||||||
```blocks
|
```blocks
|
||||||
radio.setGroup(99)
|
radio.setGroup(99)
|
||||||
radio.onReceivedValue(function (name, value) {
|
radio.onReceivedValue(function (name, value) {
|
||||||
radio.onDataPacketReceived(({ name, value }) => {
|
|
||||||
basic.showString(name);
|
basic.showString(name);
|
||||||
basic.showNumber(value);
|
basic.showNumber(value);
|
||||||
});
|
});
|
||||||
|
BIN
docs/static/mb/projects/analog-pin-calibrator.png
vendored
Normal file
BIN
docs/static/mb/projects/analog-pin-calibrator.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
BIN
docs/static/mb/projects/light-level-calibrator.png
vendored
Normal file
BIN
docs/static/mb/projects/light-level-calibrator.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
BIN
docs/static/mb/projects/servo-calibrator.png
vendored
Normal file
BIN
docs/static/mb/projects/servo-calibrator.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
@ -75,6 +75,7 @@
|
|||||||
"Music": "projects/music",
|
"Music": "projects/music",
|
||||||
"Toys": "projects/toys",
|
"Toys": "projects/toys",
|
||||||
"Science": "projects/science",
|
"Science": "projects/science",
|
||||||
|
"Tools": "projects/tools",
|
||||||
"Turtle": "projects/turtle",
|
"Turtle": "projects/turtle",
|
||||||
"Examples": "examples"
|
"Examples": "examples"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user