Bump V3.0.22 (#110)
* change simulator svg * change radio image * Remove google fonts cdn * change color of 'advanced' button * font fix * font fix 2 * display fix * change fullsceen simulator bg * Continuous servo * handle continuous state * adding shims * update rendering for continuous servos * fixing sim * fix sig * typo * fix sim * bump pxt * bump pxt * rerun travis * Input blocks revision - add Button and Pin event types - merge onPinPressed & onPinReleased in new onPinEvent function - create new onButtonEvent function * update input blocks in docs and tests * remove device_pin_release block * Hide DAL.x behind Enum * bring back deprecated blocks, but hide them * shims and locales files * fix input.input. typing * remove buildpr * bump V3 * update simulator aspect ratio * add Loudness Block * revoke loudness block * Adds soundLevel To be replaced by pxt-common-packages when DAL is updated. * Remove P0 & P3 from AnalogPin Co-authored-by: Juri <gitkraken@juriwolf.de>
This commit is contained in:
20
docs/blocks/loops/for-of.md
Normal file
20
docs/blocks/loops/for-of.md
Normal file
@ -0,0 +1,20 @@
|
||||
# @extends
|
||||
|
||||
## #examples
|
||||
|
||||
## Example: Find the highest number
|
||||
|
||||
Find the highest number in a list of numbers. Display the highest number on the screen.
|
||||
|
||||
```blocks
|
||||
let list: number[] = []
|
||||
let highest = 0
|
||||
highest = 0
|
||||
list = [5, 8, 6, 2, 4, 3, 7, 1]
|
||||
for (let value of list) {
|
||||
if (value > highest) {
|
||||
highest = value
|
||||
}
|
||||
}
|
||||
basic.showNumber(highest)
|
||||
```
|
15
docs/blocks/loops/for.md
Normal file
15
docs/blocks/loops/for.md
Normal file
@ -0,0 +1,15 @@
|
||||
# @extends
|
||||
|
||||
## #examples
|
||||
|
||||
## Example: Count to 4
|
||||
|
||||
This program will show the numbers 0, 1, 2, 3, and 4 one after another on the LED screen.
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
for(let i = 0; i < 5; ++i) {
|
||||
basic.showNumber(i)
|
||||
}
|
||||
})
|
||||
```
|
16
docs/blocks/loops/repeat.md
Normal file
16
docs/blocks/loops/repeat.md
Normal file
@ -0,0 +1,16 @@
|
||||
# @extends
|
||||
|
||||
## #examples
|
||||
|
||||
## Example: Blinking heart
|
||||
|
||||
Flash the ``heart`` icon on the screen `4` times.
|
||||
|
||||
```blocks
|
||||
for (let i = 0; i < 4; i++) {
|
||||
basic.showIcon(IconNames.Heart)
|
||||
basic.pause(300)
|
||||
basic.clearScreen()
|
||||
basic.pause(300)
|
||||
}
|
||||
```
|
17
docs/blocks/loops/while.md
Normal file
17
docs/blocks/loops/while.md
Normal file
@ -0,0 +1,17 @@
|
||||
# @extends
|
||||
|
||||
## #examples
|
||||
|
||||
## Example: diagonal line
|
||||
|
||||
The following example uses a while loop to make a diagonal line on the LED screen (points `0, 0`, `1, 1`, `2, 2`, `3, 3`, `4, 4`).
|
||||
|
||||
```blocks
|
||||
input.onButtonPressed(Button.A, () => {
|
||||
let index = 4;
|
||||
while(index >= 0) {
|
||||
led.plot(index, index);
|
||||
index--;
|
||||
}
|
||||
})
|
||||
```
|
Reference in New Issue
Block a user