A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://microbit-micropython.readthedocs.io/en/v1.0.1/devguide/repl.html below:

Accessing the REPL — BBC micro:bit MicroPython 1.0.1 documentation

BBC micro:bit MicroPython Accessing the REPL¶

REPL (Read-Evaluate-Print-Loop) allows the micro:bit to read and evaluate code in real-time as you write it.

Accessing the REPL on the micro:bit will require you to:

For versions of Windows before 10 you might need to install the Mbed serial driver, the instructions for which are found here:

https://os.mbed.com/docs/latest/tutorials/windows-serial-driver.html

Using a serial communication program¶

The Mu Editor has built-in support for REPL and even includes a real-time data plotter. Some other common options are picocom and screen. You will need to install a program and read the appropriate documentation to understand the basics of connecting to a device.

Determining the port¶

The micro:bit will have a port identifier (tty, usb) that can be used by the computer for communicating. Before connecting to the micro:bit we must determine the port identifier.

Windows

When you have installed the aforementioned drivers the micro:bit will appear in device-manager as a COM port.

Mac OS

Open Terminal and type ls /dev/cu.* to see a list of connected serial devices; one of them will look like /dev/cu.usbmodem1422 (the exact number will depend on your computer).

Linux

In terminal, type dmesg | tail which will show which /dev node the micro:bit was assigned (e.g. /dev/ttyUSB0).

Communicating with the micro:bit¶

Once you have found the port identifier you can use a serial terminal program to communicate with the micro:bit.

Windows

You may wish to use Tera Term, PuTTY, or another program.

In Tera Term:
In PuTTY:

Mac OS

Open Terminal and type screen /dev/cu.usbmodem1422 115200, replacing /dev/cu.usbmodem1422 with the port you found earlier. This will open the micro:bit’s serial output and show all messages received from the device. To exit, press Ctrl-A then Ctrl-D.

Linux

Using the screen program, type screen /dev/ttyUSB0 115200, replacing /dev/ttyUSB0 with the port you found earlier.

Using picocom, type picocom /dev/ttyACM0 -b 115200, again replacing /dev/ttyACM0 with the port you found earlier.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4