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
This commit is contained in:
Tim Hadwen
2026-02-28 19:00:42 +10:00
parent 5233233662
commit 707c49dd3f
320 changed files with 22333 additions and 107 deletions

View File

@@ -0,0 +1,100 @@
---
title: "Random Bug Bot 2"
date: "2022-03-13"
categories: ["Activities", "All"]
tags: ["Colour Sensors", "Branching", "Iteration", "Variables", "Motors", "Maths", "Advanced"]
excerpt: "Program your rover to move like a bug!"
featuredImage: "/images/resources/random-bug-bot-2.png"
---
** **
Build from the Basic Bug Bot exercise but program the rover to have a more complex lifecycle. Create a mesh of food markers on the ground for the rover to detect with colour sensors. The new bug bot rover should now have health that goes down each second as the rover gets hungry. When the rover detects food on the floor, increase the rover's health. If the rover reaches zero health it will stop (and die).
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/1647212932359-COOX3PZZOM19KIONJXYY/random+bug+bot+2.png)
Activity Demonstration
### Setup
You can use coloured tape on the playing surface to act as food. Randomly place food in a 30cm by 30cm playing area where each piece of food is a roughly 1-2cm square. Rovers will have difficulty detecting food chunks that are any smaller. Students will have trouble getting their rovers to detect food if they program the rover to move at max speed. A slower rover will a better chance to detect food.
### Heres Our Approach
#### Stage 1
Firstly we use a variable block for our health, we will set it to 20. We want to enter our normal lifecycle activity so we add a repeat while true loop.
#### **Stage 2**
There will be three stages to our lifecycle. Firstly, our bug bot will look for food using the colour sensor block. If it detects the colour of our food with the sensor we add 3 to the health variable and play the confirmation sound.
#### **Stage 3**
The second stage of our lifecycle is moving. We will use a left and right variable block here to make random numbers, then use those in our set motor speeds block to create random movement. We will also make the duration of movement set to 1 second all the time, this is important for our death countdown.
#### **Stage 4**
The final stage of our lifecycle is reducing life and checking for death. First we reduce our life by 1. We then use an if statement to check if we have reached 0 health. If we have, we are dead, break the loop to stop our lifecycle. If we have more than 0 health, we will display the health count on the rover screen.
![](https://images.squarespace-cdn.com/content/v1/60a43bf842d7b601064a8828/3e551567-3b57-4056-9be4-dfac9926e55d/random+bug+bot+2+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)