pxt-microbit
Version:
micro:bit target for Microsoft MakeCode (PXT)
50 lines (30 loc) • 1.65 kB
Markdown
# Name Tag
### @explicitHints true
## Turn your micro:bit into a digital name tag @unplugged
See your name in 💡 lights! 💡 Code the micro:bit to scroll your name across the screen.

## {Step 1}
Use the basic ``||basic:show string||`` function to display the text `"My name is: "`. Type the code below, or drag a code snippet from the ``||basic:Basic||`` Toolbox category.
```spy
basic.showString("My name is: ")
```
## {Step 2}
Add another ``||basic:show a string||`` line of code, and type in your first name.
```spy
basic.showString("My name is: ")
basic.showString("Sarah!")
```
## {Step 3}
Add another ``||basic:show string||`` line of code, and display the text `"My age is: "`. Then use the basic ``||basic:show number||`` function to display your age.
```spy
basic.showString("My name is: ")
basic.showString("Sarah!")
basic.showString("My age is: ")
basic.showNumber(9)
```
## {Step 4}
Look at the @boardname@ simulator on the screen. Do you see your name and age? ⭐ Great job! ⭐ You've turned the micro:bit into a digital name tag!
## {Step 5}
If you have a @boardname@ device, connect it to your computer and click the ``|Download|`` button. Follow the instructions to transfer your code onto the @boardname@ and watch your name and age appear in lights!
## {Step 6}
Go further - try adding more ``||basic:show string||`` and ``||basic:show number||`` functions to tell people more about yourself (favorite color, lucky number). Learn more about how the @boardname@ lights work by watching [this video](https://youtu.be/qqBmvHD5bCw).