pxt-calliope/docs/tutorials/getting-started.md
Juri Wolf a93febb5b7
Map and clean deprecated functions (#175)
* add image and deprecated arrow functions

* update locales

* map basic.showArrow

* map arrow blocks

* map & remove arrow images

* remove arrow blocks

* update locales

* remove & patch:
rgbw -> rgb
button/pin pressed -> button/pin event
loudness -> soundLevel

* update ts mappings for arrows

* add wip ts patch rules

* update .blocks files

* use Click instead of Down as default in Documentation and tests

* patch test.blocks

* fix lowercase name tag

* update test.blocks

* update blocks test files

* update blocks test files

* format block files

* pass blocks file tests

* fix ts mapping

* fix color.defl value

closes https://github.com/microsoft/pxt-calliope/issues/136

* fix ts mappings

- add optional spacing at the end of rgbw()
- map up to v4.0.19

* add suggested changes

* replace innerText by textContent

Co-authored-by: JW <gitkraken@juriwolf.de>
Co-authored-by: Juri <info@juriwolf.de>
2022-04-26 10:28:42 -07:00

70 lines
1.7 KiB
Markdown

# Getting Started
## Step 1
Welcome! Place the ``||basic:show string||`` block in the ``||basic:on start||`` slot. Replace the ``"Hello"`` text with your name. Did you see it scroll in the simulator?
```blocks
basic.showString("Micro!")
```
## Step 2
Well, the text stopped scrolling. Place the ``||basic:show string||`` block in the ``||input:on button pressed||`` slot to scroll your name when button **A** is pressed.
```blocks
input.onButtonEvent(Button.A, ButtonEvent.Click, () => {
basic.showString("Micro!")
});
```
## Step 3
Place some blocks to display a smiley when button **B** is pressed.
Use the dropdown to find ``B``!
```blocks
input.onButtonEvent(Button.B, ButtonEvent.Click, () => {
basic.showLeds(`
# # . # #
# # . # #
. . . . .
# . . . #
. # # # .
`)
})
```
## Step 4
Place the ``||basic:show number||`` and ``||Math:pick random||`` blocks in an ``||input:on shake||`` block to build a dice.
```blocks
input.onGesture(Gesture.Shake, () => {
basic.showNumber(randint(0, 10))
})
```
## Step 5
A typical dice shows values from `1` to `6`. So, in ``||Math:pick random||``, don't forget to choose the right minimum and maximum values!
```blocks
input.onGesture(Gesture.Shake, () => {
basic.showNumber(randint(1, 6))
})
```
## Step 6
If you have a @boardname@, connect a USB cable to it and click ``|Download|``. Save the program to the **@drivename@** drive. This transfers your code to the @boardname@!
## Step 7
On the @boardname@, press button **A** to scroll your text. Press button **B** to show a smiley. Shake the @boardname@ and see which number is chosen.
## Step 8
Well done! You've completed your first Microsoft MakeCode activity.