Major site overhaul: resources hub, content migration, new blog posts, forms
- 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
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: "How to Export Sensor Data From the Rover"
|
||||
date: "2023-04-11"
|
||||
categories: ["Guides"]
|
||||
categories: ["Advanced Guides"]
|
||||
tags: []
|
||||
excerpt: "In this tutorial, we will show you how to use the rover as a data collection device to assist with analysis and experiments.Why Collect Data?:While the ‘print’ function can display values on the terminal, sometimes we need to see many lines of inform"
|
||||
featuredImage: "/images/resources/how-to-export-sensor-data-from-the-rover.PNG"
|
||||
@@ -15,11 +15,7 @@ While the ‘print’ function can display values on the terminal, sometimes we
|
||||
|
||||
## How to Use the Code:
|
||||
|
||||
Shown below is the code used to collect data from the rover. Note that this code must be used in an external code editor. Not sure how to do this? Click the button below for our tutorial on getting stared with external code editors:
|
||||
|
||||
[
|
||||
Getting Setup with the Micromelon Python Module
|
||||
](getting-started-with-the-python-module)
|
||||
Shown below is the code used to collect data from the rover. Note that this code must be used in an external code editor. Not sure how to do this? Click the button below for our tutorial on getting stared with external code editors:[Getting Setup with the Micromelon Python Module](getting-started-with-the-python-module)
|
||||
|
||||
Shown below is the whole code used to record sensor data from the rover. Once the code has completed running, there will be a ‘data.csv’ file in the same folder as the code which contains the recorded data. Make sure to copy the data to an excel file as this file is overwritten each time the code is run.
|
||||
|
||||
@@ -159,7 +155,7 @@ output_file = record_data(output_file)
|
||||
|
||||
Next, we’ll show you some tips and tricks to record data:
|
||||
|
||||
**Collect data on prompt: **This code below will take a reading of data when the middle colour sensor sees black
|
||||
**Collect data on prompt:** This code below will take a reading of data when the middle colour sensor sees black
|
||||
|
||||
```
|
||||
# ENTER YOUR CODE BELOW THIS LINE
|
||||
@@ -172,7 +168,7 @@ while True:
|
||||
|
||||
```
|
||||
|
||||
**Record data for 3 seconds: **This is to record all sensor data for a set amount of time
|
||||
**Record data for 3 seconds:** This is to record all sensor data for a set amount of time
|
||||
|
||||
```
|
||||
# ENTER YOUR CODE BELOW THIS LINE
|
||||
@@ -184,7 +180,7 @@ while (current_time() - start_recording) < 3:
|
||||
|
||||
```
|
||||
|
||||
**Control the amount of data points: **If the code is recording too many data points, you can limit how often it records. In the example below, the rover only records data once every 500 iterations of the loop. Increase this number to record fewer data points.
|
||||
**Control the amount of data points:** If the code is recording too many data points, you can limit how often it records. In the example below, the rover only records data once every 500 iterations of the loop. Increase this number to record fewer data points.
|
||||
|
||||
```
|
||||
# ENTER YOUR CODE BELOW THIS LINE
|
||||
@@ -201,7 +197,7 @@ while (current_time() - start_recording) < 3:
|
||||
|
||||
## Demonstration:
|
||||
|
||||

|
||||

|
||||
|
||||
In our demonstration, we will setup the rover on the platform as shown. The idea is for the rover to drive forward, and record the brightness from each colour sensor. Data point collection has been limited to once every 500 loops and recording will stop when the ultrasonic sensor sees the block at the end of the platform. Shown below is the configuration of the code that was used:
|
||||
|
||||
@@ -299,6 +295,6 @@ rc.end()
|
||||
|
||||
Once the code was run, the ‘data.csv’ file was opened up in Microsoft Excel, and graphed.
|
||||
|
||||

|
||||

|
||||
|
||||
Looking at the graph, we are now able to analyse how the sensors interpret the platform and the shade of the tape. There are three distinct drops in the data where the rover passed over the tape. This information can be used to easily analyse the brightness readings of each colour sensor on different surfaces.
|
||||
|
||||
Reference in New Issue
Block a user