2017-01-01 18:52:22 -08:00
# Getting started
### Step 1
2017-08-18 07:43:50 -07:00
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?.
2017-01-01 18:52:22 -08:00
2017-01-06 04:32:53 -08:00
```blocks
2017-03-30 14:14:39 -07:00
basic.showString("Micro!")
2017-01-01 18:52:22 -08:00
```
### Step 2
2017-08-18 07:43:50 -07:00
Connect a USB cable to the @boardname @ and click ``|Download|` `. Save the program to the ** @drivename @** drive. This transfers your code to the @boardname @!
2017-01-01 18:52:22 -08:00
### Step 3
2017-08-18 07:43:50 -07:00
Well, the text stopped. Place the ``||basic:show string||`` block in the ``||input:on button pressed||` ` slot to scroll your name when button **A** is pressed.
2017-01-01 18:52:22 -08:00
2017-01-04 10:06:47 -08:00
```block
2017-01-06 04:32:53 -08:00
input.onButtonPressed(Button.A, () => {
2017-03-30 14:14:39 -07:00
basic.showString("Micro!")
2017-01-06 04:32:53 -08:00
});
2017-01-01 18:52:22 -08:00
```
2017-01-06 04:32:53 -08:00
2017-01-01 18:52:22 -08:00
### Step 4
2017-08-18 07:43:50 -07:00
Click ``|Download|` ` to save and transfer your code again, then press button **A** to scroll your text.
2017-01-06 04:32:53 -08:00
### Step 5
2017-08-18 07:43:50 -07:00
Place some blocks to display a smiley when button **B** is pressed.
2017-03-30 14:14:39 -07:00
####
2017-01-17 11:37:20 -08:00
Use the dropdown to find ``B` `!
2017-01-01 18:52:22 -08:00
2017-01-04 10:06:47 -08:00
```block
input.onButtonPressed(Button.B, () => {
basic.showLeds(`
2017-01-06 04:32:53 -08:00
# # . # #
# # . # #
2017-01-04 10:06:47 -08:00
. . . . .
2017-01-06 04:32:53 -08:00
# . . . #
. # # # .
2017-01-04 10:06:47 -08:00
`)
2017-01-02 22:14:40 -08:00
})
```
2017-01-06 04:32:53 -08:00
### Step 6
2017-01-01 18:52:22 -08:00
2017-08-09 22:00:53 -07:00
Place the ``||basic:show number||`` and ``||Math:pick random||` ` blocks
2017-08-18 07:43:50 -07:00
in an ``||input:on shake||` ` slot to build a dice.
2017-03-30 14:14:39 -07:00
####
2017-08-18 07:43:50 -07:00
When the @boardname @ is shaken, a random number between ``0`` and ``6` ` is displayed
on the screen.
2017-01-01 18:52:22 -08:00
2017-01-04 10:06:47 -08:00
```block
2017-01-06 04:32:53 -08:00
input.onGesture(Gesture.Shake, () => {
2017-03-30 14:14:39 -07:00
basic.showNumber(Math.random(7))
2017-01-02 22:14:40 -08:00
})
2017-01-01 18:52:22 -08:00
```
2017-01-17 11:37:20 -08:00
### Step 7
2017-08-18 07:43:50 -07:00
Well done! You've completed your first MakeCode activity.