Files
micromelon-website/content/resources/windup-rover.mdx
Tim Hadwen 707c49dd3f Build Your Kit page and full Micromelon website
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
2026-02-28 19:00:42 +10:00

141 lines
4.1 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: Wind-up Rover"
date: "2021-06-03"
categories: ["Activities", "All"]
tags: ["Iteration", "Variables", "Accelerometer", "Motors", "Maths", "Intermediate"]
excerpt: "Learn iteration, variables, maths, and how to use the Rovers motors and accelerometer."
featuredImage: "/images/resources/windup-rover.jpg"
---
** | **
Create a classic wind up toy out of our rover. The rover records the number of seconds that it is held upside down and once placed right way up on a surface it will move forward. The longer the rover was held upside down the longer it will move forward and the faster it will go. For more interesting wind up rovers, incorporate the LEDs and Buzzers to also respond and change to the wind up time.
####
Relevant Coding Skills
Branching
-->
Iteration
Functions
Variables
Algorithm Design
-->
Maths
####
Relevant Rover Concepts
Ultrasonic
-->
IR
-->
Colour
Gyroscope
Accelerometer
Motors
LEDs
-->
Buzzer
-->
Activity Demonstration
### Setup
The only requirement for this exercise is there be a long enough space for the rover to move in. If you've got limited space you can add a limit to wind up time.
### Heres Our Approach
#### Stage 1
Firstly we create a variable for our wind up time. Then we create a repeat while true loop so that our wind up and wind down code will repeat. Inside the loop we add an IF statement with the condition that checks the most important detail, if our rover is upside down or not.
#### **Stage 2**
When the rover is upside down we set all LEDs red and begin increasing the wind up time. We do this by adding 1 and then delaying our code for 1 second. This means each second our variable wind up time increases by 1.
#### **Stage 3**
When our rover is right way up and the wind up time is greater than zero we enter the unwinding branch. Firstly we set our LEDs green. Then we do our sound and motor commands (feel free to do your own thing here). We then decrease wind up time by 1 and delay. Once this reaches 0 we will enter the ELSE branch where we turn everything off.
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/40a5024f-93a3-4d8d-8ade-505d96aa6977/Screenshot+2023-10-31+083156.png)
Example Code
### Related Posts
Resources
[
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/1639455538805-9NI7CPKR7IYG6D4RBKAN/high+quality+sumo.png)
](/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)
[
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/1637464845856-BBPD7GTIIHHOSJCFORWF/the+ultrasonic+sensor.png)
](/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)
[
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/1625616494179-LZHZP5MUA0E0MQKEB7HC/cropped+image+4.png)
](/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)