Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses
  • Get Started with micro:bit and Python

Get Started with micro:bit and Python

Use the Serial Monitor

The micro:bit Python Editor’s serial monitor is great for displaying messages from the mico:bit.  You can also type messages into the serial monitor to send them to the micro:bit. 

Another nice thing about the serial monitor is that there’s no need to wait for messages to scroll across the micro:bit module’s LED matrix display.  You’ll be able to see the whole massage, all at once.

Different Python statements display messages in the serial monitor.  Instead of display.scroll and display.show for the LED matrix, you’ll be using print statements to display messages and input statements to collect the text of messages you type.  

This activity will use an example script that makes the micro:bit communicate with the serial monitor.  The micro:bit will prompt you to type some text, and then repeat back what you typed. The video goes through the same steps as the checklist instructions.

  • Follow along with your own computer and micro:bit module.

 

 

  • Enter this script into the micro:bit Python Editor.
from microbit import *

while True:
    text = input('Type a message: ')
    print('You typed:', text)

 

  • Click Send to micro:bit to make the micro:bit run it.
  • Verify that the micro:bit module’s LED matrix display does not display anything.
  • Click Show serial to open the serial monitor. (Click the one above the Open button, not the one under the simulator!)

 

  • Check for the ’Type a message:’ prompt.  If it doesn’t appear, try clicking the Send to micro:bit button again.  You might need to try more than once before it takes.
    • If the ’type a message’ prompt did not appear and clicking the Send to micro:bit button a couple times doesn’t fix it, try this:
      • Click the 3 dots to the right of the Show serial, and select the Send Ctrl+D to reset option.
      • Then, click the Send to micro:bit button again, and it should start working.
  • Click to the right of the ’Type a message:’ prompt, type a message, and press the Enter key.
  • Make sure the serial monitor responds with ’You typed:’ and then a repeat of the message you typed.

Try this: Display What You Type in LED Matrix too

  • Add display.scroll(text) immediately below the print(’You typed:’, text) statement.  Make sure display.scroll(text) is at the same level of indentation as print(’You typed:’, text).
  • Click Send to micro:bit.
  • Type a message into the serial monitor.
  • Verify that the message you typed is displayed on both the serial monitor AND on the micro:bit module’s LED matrix.

 


Printer-friendly version
Editor Controls and Left Side Panel
Prev

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2025 Parallax Learn • Built with GeneratePress