Add 'population traits' lesson to science exp (#655)

This commit is contained in:
Galen Nickel 2018-02-15 19:43:25 -08:00 committed by Peli de Halleux
parent 760940b37d
commit 11c3ac80b2
7 changed files with 227 additions and 1 deletions

View File

@ -15,7 +15,7 @@ This is a new course, so we're adding new lessons. All lessons will be available
The lesson series includes:
* [Data Collection Methods](/courses/ucp-science/data-collection)
* Population Trait Data Counter
* [Population Trait Data Counter](/courses/ucp-science/population)
* Temperature Data
* Soil Moisture Tester
* Body Electrical & Waves

View File

@ -0,0 +1,15 @@
# Population Trait Data Counter
Patterns occur everywhere in nature. Certain characteristics in a populations are called traits. Surveys are used to record and help to understand these traits. In this lesson, the @boardname@ is used as a survey tool to count traits. The @boardname@ saves the counts and reports them on the display when asked.
## Contents
* [Overview](/courses/ucp-science/population/overview)
* [Setup and procedure](/courses/ucp-science/population/setup-procedure)
* [Resources](/courses/ucp-science/population/resources)
<br/>
| | | |
|-|-|-|
| Adapted from "[Population Trait Data Counter](https://drive.google.com/open?id=1CC5uhIoZK4Q67vU5Ldwna6GEeZYXNDYzgO8BUUjPuwI)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,43 @@
# Overview
## Science Concept
Surveys of different characteristics in a population can be done in several different ways. If it is people responding to a survey it could be done orally, on paper, or electronically to collect the data. If it is done by observation, it could be done with tally marks on a paper. If 2 different characteristics are being observed it is really hard to mentally keep track of 2 counts in a persons head. It could be done on a @boardname@ using the **A** and **B** buttons as increment counters. The @boardname@ could also be programmed to show the 2 tallys and the total number observed.
The strands and standards in 7th grade SEEd 7.5 talk about “... variation and the proportion of traits within a population can change over time…” Observing current traits in a population is a start to looking at changes in a population overtime. Standard 7.5.2 “Analyze and interpret data for patterns...” Possible observations could include: blond vs non blond, male vs female, cars vs trucks, right handed vs left handed, etc.
![micro:bit display for counting traits](/static/courses/ucp-science/population/microbit-display.jpg)
## Project Goal
Learn coding with math concepts to create a microbit 2 trait counter.
## Prior Knowledge
Students need to:
* Have a basic knowledge of how to code using block style programming (Scratch, Code.org, etc.)
* Basis knowledge of the MakeCode programming environment.
* Knowledge of using variables and basic math in coding the microbit.
* Knowledge file management skills in Windows.
* How to download a program and copy it to a microbit. Checkout this guide: [Using a Microbit in 5 easy steps](http://microbit.org/guide/quick/).
## Student Outcomes
Students will:
* Create experiments to collect data using a microbit to collect and count 2 types of data.
* Setup different experiments to observe the gravity effect.
* Code the microbit using variables, counters, and math to collect and display data.
* Analyze report on the data collected.
## Materials Needed
* 1 @boardname@ with battery connected
* Windows 10 MakeCode app or [MakeCode](@homeurl@) in a browser.
<br/>
| | | |
|-|-|-|
| Adapted from "[Population Trait Data Counter](https://drive.google.com/open?id=1CC5uhIoZK4Q67vU5Ldwna6GEeZYXNDYzgO8BUUjPuwI)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

View File

@ -0,0 +1,48 @@
# Resources
## CSTA Standards
Computer Science Teachers Association (CSTA) Standards 2017.
http://www.csteachers.org/page/standards.
### Level 2 (Grades 6-8)
#### Computing Systems
* 02 — Design projects that combine hardware and software components to collect and exchange data.
* 03 — Systematically identify and fix problems with computing devices and their components.
#### Data & Analysis
* 07 — Represent data using multiple encoding schemes.
* 08 — Collect data using computational tools and transform the data to make it more useful and reliable.
* 09 — Refine computational models based on the data they have generated.
#### Algorithms & Programming
* 11 — Create clearly named variables that represent different data types and perform operations on their values.
* 13 — Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.
* 17 — Systematically test and refine programs using a range of test cases.
* 19 — Document programs in order to make them easier to follow, test, and debug.
## Utah Science with Engineering Education (SEEd)
* [Utah Science Website](https://schools.utah.gov/curr/science)
* [Utah Grades 6-8 SEEd Standards](https://schools.utah.gov/file/265a0b53-b6a7-48fb-b253-b6a5f38ffe19)
* [Sixth grade OER Science text](https://eq.uen.org/emedia/items/dae58176-b839-4b26-87e4-09ca5ed98875/1/Grade6RS.pdf)
* [Seventh grade OER Science text](https://eq.uen.org/emedia/items/afd89ff1-054c-4ac5-a712-67f4c6029644/1/Grade7RS.pdf)
* [Eighth grade OER Science text](https://eq.uen.org/emedia/items/e5219302-32b9-4c2f-ad65-38f303da6654/1/Grade8RS.pdf)
## micro:bit
* [Microbit.org](http://microbit.org)
* [MakeCode.com](https://makecode.com)
* [Utah Coding Project](http://utahcoding.org)
* [Blog entry on Windows 10 MakeCode app](https://sites.google.com/view/utahcodingproject/blog/2018-jan-makecode-app)
<br/>
| | | |
|-|-|-|
| Adapted from "[Population Trait Data Counter](https://drive.google.com/open?id=1CC5uhIoZK4Q67vU5Ldwna6GEeZYXNDYzgO8BUUjPuwI)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

View File

@ -0,0 +1,120 @@
# Setup and procedure
## Setup
1. The coding of this project will involve several steps.
2. The ``||basic:on start||`` block will display the title of the project. It will also declare the variables that will be used in the project. The **A** and **B** buttons are programmed to add 1 to the count for the trait associated with that button.
3. The **A** and **B** buttons are programmed to display the name of the first trait and the count. Then the name of the second trait and its count. Finally the total number counted on both buttons will be displayed.
4. The ``||input:on shake||`` event can be programmed to erase the data and start over.
## Code
### MakeCode Programming Environment
1. Open the MakeCode micro:bit editor in a browser at: @homeurl@.
2. Or download and use the [Windows 10 MakeCode](https://www.microsoft.com/store/apps/9PJC7SV48LCX) app.
### on Start event
1. Name the project, “Population Trait Counter”.
2. The ``||basic:on Start||`` event will display the title and purpose of the microbit in all caps, “POPULATION TRAIT COUNTER”. The text is put in the ``||basic:show string||`` block (the title is put in the ``||basic:on start||`` event so when the microbit is started up it will show what it is programmed to do. It is done in all CAPS because it is easier to read as it is displayed in the LED display).
3. From the ``||variables:Variables||`` toolbox create variables named ``trait1``, ``trait2``, and ``total``. These will be used as counters to keep track of the for each trait counted. Variables are named to describe what they will be storing. Variables are usually named by using lowercase letters and/or digits. If it is a 2 word name, it is usually named using camelCaps (no spaces but a capital where the second word starts. Examples: ``totalCount``, ``randNumber``, etc.)
```blocks
let trait1 = 0
let trait2 = 0
let total = 0
basic.showString("POPULATION TRAIT COUNTER")
```
The variables are declared in the ``||basic:on start||`` event and they are assigned a starting value of `0`.
### on Button “A” Pressed event
1. The ``||input:on button A||`` pressed event will be used to count the first trait by adding `1` to ``trait1`` each time the button is pressed.
2. The ``||variables:change trait1 by 1||`` is used to increment the number. In JavaScript this is done with the ``trait1 += 1`` statement. It's math statement to perform the same calculation could be ``trait1 = trait1 + 1``. This can be read as ``trait1`` gets it value from the current value of ``trait1 + 1``.
3. The next line is used to display the current value of ``trait1``.
```blocks
let trait1 = 0
// Add 1 to trait1
input.onButtonPressed(Button.A, () => {
trait1 += 1
basic.showNumber(trait1)
})
```
### on Button “B” Pressed event
1. The code for on button **B** pressed is the same as the on button **A** pressed except it is used for keep a count on ``trait2``.
```blocks
let trait2 = 0
// Add 1 to trait2
input.onButtonPressed(Button.B, () => {
trait2 += 1
basic.showNumber(trait2)
})
```
### on Button “A+B” Pressed event
1. The ``A+B`` ``||input:on button pressed||`` event is used to display the name and count for each trait and the total observations made by displaying the information on the LED screen.
2. To start out when the buttons are pressed, ``trait1`` and ``trait2`` are added to get a total count. The math for this would look like total = ``trait1`` + ``trait2`` (when calculations are make in computer programs the answer is always written on the left side of the “=” sign and the calculation is done on the right side of the sign. The “=” sign is general read as “gets its value from” rather than “equal”. The “==” is usually used as the equal comparison operator).
3. Following the calculation the name of the first trait is displayed followed by its value.
4. The same thing is done for the second trait in the next 2 lines of code.
5. The last 2 lines display the label `"TOTAL"` and its calculated value.
```blocks
let trait1 = 0
let trait2 = 0
let total = 0
// Display counted traits and total total up the
// traits for a total
input.onButtonPressed(Button.AB, () => {
total += trait1 + trait2
basic.showString("TRAIT 1")
basic.showNumber(trait1)
basic.showString(" TRAIT 2")
basic.showNumber(trait2)
basic.showString(" TOTAL")
basic.showNumber(total)
})
```
### on Shake event
1. The ``||basic:on shake||`` event is used to clear the value of all the variables much like when an “Etch-a-Sketch” is turned upside down and shaken to erase the drawing (the accelerometer sensor can detect when the @boardname@ is shaken).
2. This is done by setting the values of each of the variables back to `0`.
```blocks
let trait1 = 0
let trait2 = 0
let total = 0
// Erase count and total
input.onGesture(Gesture.Shake, () => {
trait1 = 0
trait2 = 0
total = 0
})
```
### ~hint
**Warning**
This procedure could be problematic if the @boardname@ is shaken to much while it is used in counting.
### ~
## Extensions
This project could easily be modified to keep track of scores for 2 different teams. What other ideas can you think of that counters could be used for?
<br/>
| | | |
|-|-|-|
| Adapted from "[Population Trait Data Counter](https://drive.google.com/open?id=1CC5uhIoZK4Q67vU5Ldwna6GEeZYXNDYzgO8BUUjPuwI)" by [C Lyman](http://utahcoding.org) | | [![CC BY-NC-SA](https://licensebuttons.net/l/by-nc-sa/4.0/80x15.png)](https://creativecommons.org/licenses/by-nc-sa/4.0/) |

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB