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

105 lines
4.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: "Driving School Basics"
date: "2022-03-13"
categories: ["Activities", "All"]
tags: ["Colour Sensors", "Branching", "Iteration", "Algorithm Design", "Ultrasonic", "IR", "Motors", "Simulator", "Advanced"]
excerpt: "Learn the basics of rover motors and sensors while navigating Duck City."
featuredImage: "/images/resources/driving-school-basics.png"
---
** **
[
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/d48b056d-c05e-4abd-aceb-0e397c551283/Simulator+Indicator.png)
](/robot-simulator)
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.
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/15a6a126-85b9-4443-86ab-f8432436284f/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!
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/c1c43912-907f-4caf-8778-e4c8bedb6953/driving+school+answer.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)