Files
micromelon-website/content/resources/conversation-bot.mdx
Tim Hadwen 1f8c46597b Site audit: fix broken images, add activity metadata, clean up content
- Remove broken image references from 25 MDX files (deleted spacer/content images)
- Add codingSkills and roverConcepts frontmatter to 24 activity pages
- Fix "Activity Demonstration" headings in 15 activity files (plain text -> h3)
- Remove unused "All" category from 89 MDX files
- Decode HTML entities (> <  ) in 9 content files
- Escape bare < > characters in MDX to fix build errors
- Standardize contact email to contact@micromelon.com.au
- Add missing description to rover-repair-request metadata
- Include previous session work: about-us updates, difficulty filtering,
  LearningPathway component, expanded schools list, new product/resource images

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 21:49:15 +10:00

42 lines
2.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Activity: Conversation Bot"
date: "2021-06-03"
categories: ["Activities"]
tags: ["Branching", "Iteration", "Buzzer", "LEDs", "Beginner"]
codingSkills: ["Branching", "Iteration"]
roverConcepts: ["Buzzer", "LEDs"]
excerpt: "Learn iteration, branching, and how to use the buzzer and LEDs."
featuredImage: "/images/resources/conversation-bot.png"
---
Use the input block to create a conversation between you and your rover. Use variables to save information in the conversation or ask the robot to do different tasks.
### Activity Demonstration
<iframe width="560" height="315" src="https://www.youtube.com/embed/vMITCAwrKuw" title="Conversation Bot Activity Demonstration" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen></iframe>
### Setup
This exercise doesn't necessarily require a lot of space as you can choose whether the robot will move or not. There is no limit to how the conversation can work. Try and involve things like LEDs and Sounds from the rover. This often leads to needing to use variables, branching, loops, and functions.
### Heres Our Approach
This example code is not the only conversation that can be had with the rover. This just demonstrates how you can use the input block with variables and if statements. This can be easily extended with loops, motors, sensors, and functions.
#### Stage 1
Use the request input block to greet the user and then ask which colour they prefer. We can use a print block with string concatenation to say hello. Make sure to store the inputs in well-named variables to make your code easy to read.
#### **Stage 2**
Use an IF statement to check whether the response is something we understand and the ELSE branch to say when we dont understand. Use a set all LEDs block to set the colour of the LEDs when we get a response we understand
#### **Stage 3**
Add more responses to the IF statement as ELSE IF (ELIF) branches.
![](/images/content/42e7a7-conversationbot-answer.png)
Example Code