Files
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

35 lines
2.0 KiB
Plaintext
Raw Permalink 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: Spike Drop"
date: "2022-02-23"
categories: ["Simulator Activities"]
tags: ["Colour Sensors", "Branching", "Iteration", "Ultrasonic", "Robot Simulator", "Beginner"]
codingSkills: ["Branching", "Iteration"]
roverConcepts: ["Colour", "Ultrasonic"]
excerpt: "Simulator activity for learning ultrasonic, colour sensor and iteration."
featuredImage: "/images/resources/spike-drop.jpg"
---
Find a way to drive the simulator rover into the green parking lot. Use your colour or ultrasonic sensor to help you find the safe zone. Watch out though, go to far and youll fall and get spiked!
![](/images/content/a252ca-spike-drop-demo.gif)
### Activity Demonstration
### Setup
This activity requires no physical setup, just make sure you connect the Code Editor to the Robot Simulator. If your unsure what the Robot Simulator is or need help setting it up, see our post [Getting Started With The Robot Simulator.](https://micromelon.com.au/resources/robot-simulator)
### Heres Our Approach
#### Solution 1
![](/images/content/395959-spike-drop-answer-1.png)
The first solution involves using the ultrasonic sensor. We use a repeat while true block, but instead of leaving it on true we tell it to repeat while the ultrasonic sensor detects a number larger than 55. Once our rover detects the warning wall suspended above the spikes within 55cm it means we are directly in our safe zone and can stop moving.
#### **Solution 2**
![](/images/content/383ed3-spike-drop-answer-2.png)
The second solution is a bit more dynamic, uses the colour sensor and will work better if you move the rover and it needs to detect green multiple times within the one program. The benefit here is that the program wont end on green, but it keeps making sure the colour is detected. We do this by using an IF/ELSE statement inside of a while true loop. We look for the colour green as before, but this time instead of ending the loop we just keep telling the motors to stop moving, and any other colour we will still keep the forwards movement.