pxt-calliope/docs/tutorials/getting-started.md
Amerlander 918af4f3ac
Bump V3.0.22 ()
* 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>
2020-09-08 02:04:25 -07:00

1.6 KiB

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?

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.

input.onButtonPressed(Button.A, () => {
    basic.showString("Micro!")
});

Step 3

Place some blocks to display a smiley when button B is pressed.

Use the dropdown to find B!

input.onButtonPressed(Button.B, () => {
    basic.showLeds(`
    # # . # #
    # # . # #
    . . . . .
    # . . . #
    . # # # .
    `)
})

Step 4

Place the ||basic:show number|| and ||Math:pick random|| blocks in an ||input:on shake|| block to build a dice.

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!

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.