Complete website build including: - Build Your Kit store page with cart system, sectioned layout (Hardware, Software, Attachments, Spare Parts), inline quote request form, and sticky sidebar summary - 16+ pages: Education, Platform, Resources, News, About Us, Download, Contact, Rover, Code Editor, Robot Simulator, etc. - 89+ MDX resource articles and 18 news posts - Store product images scraped from micromelon.com.au - Quote request API route with Airtable integration - Dynamic back links and cover photos on resource pages - Redesigned downloads page - Fixed corrupted MDX code blocks
141 lines
3.9 KiB
Plaintext
141 lines
3.9 KiB
Plaintext
---
|
||
title: "Activity: Conversation Bot"
|
||
date: "2021-06-03"
|
||
categories: ["Activities", "All"]
|
||
tags: ["Branching", "Iteration", "Buzzer", "LEDs", "Beginner"]
|
||
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.
|
||
|
||
####
|
||
Relevant Coding Skills
|
||
|
||
Branching
|
||
|
||
Iteration
|
||
|
||
Functions
|
||
|
||
Variables
|
||
|
||
-->
|
||
|
||
Algorithm Design
|
||
|
||
-->
|
||
|
||
Maths
|
||
|
||
####
|
||
Relevant Rover Concepts
|
||
|
||
Ultrasonic
|
||
|
||
-->
|
||
|
||
IR
|
||
|
||
-->
|
||
|
||
Colour
|
||
|
||
Gyroscope
|
||
|
||
Accelerometer
|
||
|
||
Motors
|
||
|
||
-->
|
||
|
||
LEDs
|
||
|
||
Buzzer
|
||
|
||
Activity Demonstration
|
||
|
||
### 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.
|
||
|
||
### Here’s 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 don’t 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.
|
||
|
||

|
||
|
||
Example Code
|
||
|
||
### Related Posts
|
||
|
||
Resources
|
||
|
||
[
|
||
|
||

|
||
|
||
](/resources/creating-a-sumo-unit)
|
||
|
||
[All](/resources?category=All)
|
||
|
||
[Creating A Sumo Unit For Your Digital Technologies Class](/resources/creating-a-sumo-unit)
|
||
|
||
[All](/resources?category=All)
|
||
|
||
How to run a sumo unit in your digital technologies classroom.
|
||
|
||
[Read More →](/resources/creating-a-sumo-unit)
|
||
|
||
[All](/resources?category=All)
|
||
|
||
[
|
||
|
||

|
||
|
||
](/resources/ultrasonic-sensor)
|
||
|
||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||
|
||
[The Ultrasonic Sensor](/resources/ultrasonic-sensor)
|
||
|
||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||
|
||
Learn all about the ultrasonic sensor!
|
||
|
||
[Read More →](/resources/ultrasonic-sensor)
|
||
|
||
[All](/resources?category=All), [Guides](/resources?category=Guides)
|
||
|
||
[
|
||
|
||

|
||
|
||
](/resources/year-7-digital-tech-at-st-peters)
|
||
|
||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||
|
||
[Case Study: Year 7 Digital Tech at St Peters Lutheran College](/resources/year-7-digital-tech-at-st-peters)
|
||
|
||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|
||
|
||
See how Meg Foley at St Peters conducted a challenge for their Year 7s using Micromelon.
|
||
|
||
[Read More →](/resources/year-7-digital-tech-at-st-peters)
|
||
|
||
[All](/resources?category=All), [Customer Stories](/resources?category=Customer+Stories)
|