- Redesign /resources as sectioned hub with category pages - Migrate 645 Squarespace CDN images to local /images/content/ - Create 9 new news/blog posts with event photos - Fix blog post slugs (rename gibberish filenames) - Rename Design Blog to Design Blogs across site - Remove education page, replace with Platform in nav - Redesign rover repair request form with dynamic rover entries - Add school search combobox to contact, store, and repair forms - Extract shared KNOWN_SCHOOLS data - Make /rover-expansion-3d-printing dynamically pull from MDX - Add related resources sections to product pages - Fix homepage broken /quote links to /store - Store page: sample kit cards, inline quote builder, mailing list opt-in
84 lines
1.7 KiB
Plaintext
84 lines
1.7 KiB
Plaintext
---
|
||
title: "Activity: Flip Bot"
|
||
date: "2021-06-03"
|
||
categories: ["Activities", "All"]
|
||
tags: ["Branching", "Iteration", "Accelerometer", "Motors", "Intermediate"]
|
||
excerpt: "Learn branching, iteration, and how to use the accelerometer."
|
||
featuredImage: "/images/resources/flip-bot.png"
|
||
---
|
||
|
||
|
||
Program the rover to flip itself upside down and then stop. There are many solutions to this problem. The rover must flip itself without being touched while running and once it has flipped it should stop. You could try combining this with the Turn Over Rover program to include lights.
|
||
|
||
####
|
||
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 most common way to flip the rover is having it drive up a flat vertical surface and fall backwards. Perhaps using the back of a laptop screen, a book, or a wall. These are not the only solutions. See what other driving conditions might make the robot flip.
|
||
|
||
### Here’s Our Approach
|
||
|
||
This solution can be extended to make the rover reset itself and include LEDs
|
||
|
||
#### Stage 1
|
||
|
||
Start moving forward to eventually encounter a vertical obstacle.
|
||
|
||
#### **Stage 2**
|
||
|
||
Add a repeat block where the condition is a sensor block that checks if the rover is right way up. This will cause the rover to wait until it is not the right way up.
|
||
|
||
#### **Stage 3**
|
||
|
||
After the loop that waits for the robot to flip we add a motor block to stop the rover.
|
||
|
||

|
||
|
||
Example Code
|