For this project we are going to build a Code Club to show your micro:bit's name and your Code Club Team's name.
//
Let's start by showing your micro:bit's name when we press the A button
input.onButtonPressed(Button.A, function () {
basic.showString(control.deviceName())
})
Let's create a Variable called "Team", your micro:bit will use this to show your team name Set your Team name in the "Team" variable
let Team = ""
Team = "Zork"
Let's show your team name with the B button is pressed.
input.onButtonPressed(Button.B, function () {
basic.showString(Team)
})
Download your code onto your micro:bit to see it working
<script src="https://makecode.com/gh-pages-embed.js"></script><script>makeCodeRender("{{ site.makecode.home_url }}", "{{ site.github.owner_name }}/{{ site.github.repository_name }}");</script>