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
  • Variable
  • Set variable
  • Change variable
  1. Blockly Elements
  2. Advanced Blocks

Variables

Last updated 1 year ago

The Variables folder contains the blocks need to create variables. Variables are a fundamental concept in programming that allow you to store and manage data throughout your program. They are like containers that hold values, and you can refer to them by their names to access or modify the values they contain.

They are useful for many reasons, like storing data, sharing data between blocks, reusing values, making the code more readable and improving the code efficiency.

Once you click on the variables folder you will be able just to see this screen (See image below). In order to create a variable you need to click on the "Create variable..." block and a window will pop up on your screen. You need to write the name of your variable, in this case "x", and then press OK. After this sequence, the variables folder will add several variable blocks with the value "x" that you can use in your program. If you want to add more variables the folder will put them in the order you create them, you will also be able to choose which variable you need in the drop-down.

We will show the way to delete a variable in the description of the different blocks.

Variable

The variable block is used when you need to use your variable in your program. You can connect it wherever you can find a block with a socket. The variable block will represents a value or a text string.

When you click on its options you can easily change which variable you are referring to, you can rename it or delete the variable itself.

Set variable

This is a fundamental block when you work with variables. You can use this block to assign a value, a text or an event message to a variable. By clicking on the drop-down you will find exactly the same options as in the variable block.

Change variable

With this block, you can change the value of the variable by adding the number contained in the blue block. By clicking on the arrow you will find exactly the same options as in the variable block.

🅰️
image 1
image 2
image 3
image 4
variable block
set variable block
change variable block