Files
micromelon-website/content/resources/driving-school-basics.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

43 lines
1.9 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: "Driving School Basics"
date: "2022-03-13"
categories: ["Activities"]
tags: ["Colour Sensors", "Branching", "Iteration", "Algorithm Design", "Ultrasonic", "IR", "Motors", "Simulator", "Advanced"]
codingSkills: ["Branching", "Iteration", "Algorithm Design"]
roverConcepts: ["Colour", "Ultrasonic", "IR", "Motors"]
excerpt: "Learn the basics of rover motors and sensors while navigating Duck City."
featuredImage: "/images/resources/driving-school-basics.png"
---
** **
Driving School is a virtual robot playground, with ducks, obstacles and traffic lights in the Micromelon Robot Simulator.
In Driving School Basics we program the rovers to stay in the centre of the lanes, while avoiding running over ducks and hitting other rovers.
![](/images/content/d13e2c-driving-school.gif)
### Activity Demonstration
### Setup
This exercise has no physical setup as it is completed in the Micromelon Robot Simulator. To learn more about the Robot Simulator check out the [**Getting Started With The Robot Simulator**](https://micromelon.com.au/resources/robot-simulator) post.
### Heres Our Approach
#### Stage 1
Add a while true loop and an IF/ELSE IF/ELSE statement so that we can continuously ask our rover questions about its environment.
#### **Stage 2**
The simulators roads actually have a slight brightness gradient towards the edges, so using the colour sensors you can work out where the rover is on the road. This approach uses an IF/ELSE IF/ELSE statement together with the colour sensor blocks to work out whether it is too far to the left or right. You can use the set motor speeds blocks to slightly turn to the left or right and adjust the position on the road.
#### **Stage 3**
Now we need to make sure we do not run into the duck! We can use our front ultrasonic sensor distance block to get our robot to wait for the duck to cross. It will also avoid other rovers now!
![](/images/content/dba11b-driving-school-answer.png)
Example Code