Files
micromelon-website/content/resources/dance-dance-rover-lution.mdx
Tim Hadwen ae3ae18585 Major site overhaul: resources hub, content migration, new blog posts, forms
- Redesign /resources as sectioned hub with category pages
- Migrate 645 Squarespace CDN images to local /images/content/
- Create 9 new news/blog posts with event photos
- Fix blog post slugs (rename gibberish filenames)
- Rename Design Blog to Design Blogs across site
- Remove education page, replace with Platform in nav
- Redesign rover repair request form with dynamic rover entries
- Add school search combobox to contact, store, and repair forms
- Extract shared KNOWN_SCHOOLS data
- Make /rover-expansion-3d-printing dynamically pull from MDX
- Add related resources sections to product pages
- Fix homepage broken /quote links to /store
- Store page: sample kit cards, inline quote builder, mailing list opt-in
2026-03-01 17:14:05 +10:00

37 lines
2.2 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: "Dance Dance Rover-lution"
date: "2022-03-13"
categories: ["Activities", "All"]
tags: ["Iteration", "Functions", "Buzzer", "Motors", "LEDs"]
excerpt: "Time to boogie down with some programming."
featuredImage: "/images/resources/dance-dance-rover-lution.png"
---
** **
Lets hold a dance contest in the classroom for rovers to compete in! Students can program the motors to perform dance moves, use LEDs and add sounds to add flair to their dance. Students are encouraged to use loops and functions to simplify their code. Points will be awarded to students who make good use of the rovers tools and well written code.
![](/images/content/1292fa-dance-dance-roverlution.png)
### Setup
When running this exercise we like to group students to create collaborative dance routines involving multiple rovers. You can pick group sizes that work for your classroom. We find 4-5 students working together to create a dance routine involving 3 rovers is a good sizing. The rest of the setup depends on what you have available in the classroom. You could add obstacles or props to make the performance more interesting.
### Heres Our Approach
![](/images/content/159e0f-dance-dance-roverlution-answer.png)
Example code
#### Stage 1
There isn't a single correct solution for this challenge as each student will program their robots differently. Regardless of solution, we encourage students to use functions to organise their code. The example here shows how you can use a function to create a dance move and keep code organised.
#### **Stage 2**
Function blocks work in pairs. There is a block that holds all the instructions, and a small single block that calls upon those instructions. For this example, from the functions category we drag in a function block and name it FancySpin. Inside our function block we place our dance moves. These blocks inside the function is what will run when we call the function. With this example we will set some LEDs, play some sounds and make the rover spin around.
#### **Stage 3**
From our start block we are going to add a loop block that runs twice. Inside the loop we will call the FancySpin function to run by adding the FancySpin block. This means all of the blocks inside of our FancySpin function will be played twice.