Misty Lessons
  • Misty Lessons
    • 📖Welcome to Misty Lessons
    • 📚Get to know your Misty
    • 📲Connect to Misty
    • 👩‍💻Misty Studio
    • 🖥️Desktop Environment
    • ⬆️Update your Misty
    • 👥Projects
  • Blockly
    • 🧩Blockly Lessons
      • 🤸Lesson 1: Movement
      • 🎶Lesson 2: Voice and Sound
      • 🎭Lesson 3: Expressions
      • 🎥Lesson 4: Robot Cinema
      • 🛠️Lesson 5: Events
      • ☺️Lesson 6: Face recognition
      • 🔢Lesson 7: Variables and Functions
      • 💬Lesson 8: NLP
    • 🏫Blockly projects
  • Blockly Elements
    • ⚛️Misty Blocks
      • Movement
      • Speech
      • Audio
      • Vision
      • Events
      • Miscellaneous
      • NLP
      • System
    • 🔁Basic Blocks
      • Logic
      • Loops
      • Math
      • Text
      • Lists
    • 🅰️Advanced Blocks
      • Variables
      • Functions
  • Python
    • 🐍Python Lessons
      • 🦿Lesson 1: Loco-motion
      • 🤖Lesson 2 : Build a character
      • 🧠Lesson 3: Create memories
      • ⚒️Lesson 4: Event skills
      • 👀Lesson 5: Expand awareness
      • 🔗Lesson 6: Compact code
      • 🗣️Lesson 7: Start a conversation
  • Python Elements
    • 🐸Misty Python API
      • Motion and Mobility
      • Display and LED
      • Record Assets
      • Change/Remove Assets
      • Stream Assets
      • Get Assets
      • Events
      • Sensor Events
      • Speech and NLP
      • Arduino Backpack
      • System
      • Slam
    • 📗Python Definitions
  • Python Projects
    • 🔮MistyGPT
    • 🚨Misty Intruder Alert
    • 📺Conference Assistant
    • 🏷️QR code detector
    • 🕵️‍♂️Misty follow human
    • 👋Misty wave back
    • 🖲️Misty OA
    • 🌐Get weather
    • 🚚Misty Delivery
    • 🫂Motivational Misty
    • 🖼️Misty Museum Guide
    • 🎃Who for Halloween
  • ARDUINO
    • ♾️Arduino Backpack
    • 🦎Arduino
    • 🔧Arduino Lessons
      • 🔌Arduino to Misty
      • ➕Misty to Arduino
  • ARDUINO PROJECTS
    • 🛠️Misty Tracker
    • 🦾Misty Arm
  • Community Projects
    • 🌤️Misty weather forecaster
  • HARDWARE EXTENSION
    • ⚙️Arduino breadboard support
    • 🦾Misty arm
    • 🥤Tin holder
  • Resource Database
    • 📁Image files
    • 📁Audio files
    • 📁Languages
    • 📁Known objects
    • 📁NLP Actions
    • 📁Action Commands
    • 📁ChatGPT PDF files
    • 📁AR Tag Dictionary
    • ⚙️Technical Specifications
Powered by GitBook
On this page
  • Text
  • Build text
  • Append text
  • Other text block editors
  • Prompt the user for some text
  • Strings operators
  1. Blockly Elements
  2. Basic Blocks

Text

Last updated 1 year ago

The Texts folder in Blockly is useful for manipulating text and contains Blocks that you will need to enable Misty's Text-To-Speech. These blocks can be used for basic text operations, such as concatenation, splitting, and searching. It also contains blocks for more advanced text operations, such as regular expression matching and text formatting.

The Texts folder also contains blocks for working with variables, functions, and conditional statements. This allows you to write complex text manipulation expressions in Blockly.

Text

This is a simple text block. By clicking on the text field you can start writing numbers, letters or strings. This is often used together with Misty's speech blocks.

Build text

With this block, you can create your own text blocks. Its different from the previous one because here you can combine variables and normal text. It means it can be used in functions and in more advanced applications for Misty.

By clicking on the gear icon you can join multiple items and build the text as long as you like.

Append text

With this block, you can add some text to a specified item, as well as other text blocks.

Other text block editors

These blocks provide a variety of functionalities and return different values:

  • The first block returns the length of the string.

  • The second block prints the string contained.

  • The third block returns true if the block is empty.

  • The fourth block changes everything in the blue box to UPPER CASE or lower case or Title Case.

  • The fifth block trims some space next to the block (both sides, right side or left side only). It can also be used for example next to variables in the build text block in order to create well-readable text.

Prompt the user for some text

The "Prompt for Text" block in Blockly is a feature that allows a program to request and receive text input from a user. When this block is used within a Blockly program and executed, it triggers an interface or dialogue that asks you to input text.

The purpose of this functionality is to have the robot give requests for input to the user.

Strings operators

These three blocks in Blockly provide operations with strings :

  • The first block returns the letter in a specified position, 0# is the first letter.

  • The second block returns a specified portion of the text.

  • The third block returns the index of the first, or last, occurrence of the first text in the second text. It returns -1 if the variable text is not found.

Note: Numbers written in the math blocks are "read" with their value, instead numbers written in the text strings are "read" as part of the language, in fact, in text strings type "five" gives exactly the same result as typing "5". This doesn't happen in the math blocks.

🔁
text blocks
text blocks
text block
build text block
append text in Misty Studio
other text editor blocks
prompt for user for some text block
strings operators blocks