Skip to content

活動

姓名徽章

初學者 | MakeCode, Python | LED 螢幕 | 算法, 輸入輸出, 迭代

步驟1:製作

它是什麼?

Turn your BBC micro:bit into a scrolling name badge with just a few instructions.

介紹

編程指引

運作方式

  • This project makes a great introduction to coding the micro:bit.
  • You’ll discover how easy it is to create sets of instructions, or algorithms, in code, which is a language a computer like a micro:bit can understand.
  • The program you’ll create scrolls text across the screen to show your name.
  • It uses an infinite loop which keeps your name scrolling on the micro:bit’s LED display output until you unplug the micro:bit from its battery or USB lead.

你需要的東西

  • micro:bit (或,MakeCode simulator)
  • MakeCode 或, Python 編輯器
  • 電池組(選配)

步驟2:編碼

1from microbit import *
2
3while True:
4    display.scroll('Amari')
5

步驟3:進階

  • Add more ‘show string’ blocks to say more about yourself.
  • Add a ‘show icon’ block to show how you’re feeling or express your personality.
  • Design a way of wearing your micro:bit badge using thread, tape or Velcro. (請勿使用安全引腳,因為金屬可能會損壞您的 micro:bit)。