How to Make the Micro:bit Speak Using Micropython and the Speech Library

by Benji45631 in Circuits > Audio

26 Views, 0 Favorites, 0 Comments

How to Make the Micro:bit Speak Using Micropython and the Speech Library

microbit.png

We can make the micro:bit V2 speak through its in-built speaker, and MicroPython.

Supplies

A microbit V2

Internet

Laptop or PC

USB cable for microbit

Micropython

Go to MicroPython and import speech.

Code

Here is the code. When you press A the microbit will say hello

# Imports go at the top
from microbit import *
import speech
while True:
if button_a.was_pressed():
speech.say('Hello')