AJB2K3
Published © CC BY-NC-SA

Getting Started with the M5Stack Atom STT

Use Echo S.T.T to add voice commands to your M5Stack based projects

BeginnerProtip1 hour1,059
Getting Started with the M5Stack Atom STT

Things used in this project

Hardware components

M5Stack ATOMU-ESP32-DEVELOPMENT-KIT-WITH-USB-A
×1
M5Stack Core2 ESP32 IoT Development Kit
M5Stack Core2 ESP32 IoT Development Kit
×1

Software apps and online services

Google Chrome Web Browser
M5Stack UIFlow

Story

Read more

Code

Simple EchoSTT example.

MicroPython
This code must be copied to a core2. when running, it will wait for messages sent out from the AtomU
from m5stack import *
from m5stack_ui import *
from uiflow import *
from echo import Echo
import wifiCfg

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)


stt_data = None

wifiCfg.autoConnect(lcdShow=False)

label0 = M5Label('label0', x=5, y=76, color=0x000, font=FONT_MONT_14, parent=None)




def echo_callback(*args):
  global stt_data
  stt_data = args[0]
  label0.set_text(str(stt_data))
  if stt_data == 'all red':
    rgb.setColorAll(0xff0000)
  if stt_data == 'old blue':
    rgb.setColorAll(0x3366ff)

  pass


echo = Echo(str('****InsertOwnTokenHere****'))
echo.set_callback(echo_callback)
while True:
  wait_ms(2)

Credits

AJB2K3

AJB2K3

45 projects • 28 followers
I have always had an interest in electronics but having failed my school exams, it has taken me 20+ years to produce products to share.

Comments