Merge branch 'master' of https://github.com/Microsoft/pxt-microbit
@ -15,7 +15,7 @@ This is a new course, so we're adding new lessons. All lessons will be available
|
|||||||
The lesson series includes:
|
The lesson series includes:
|
||||||
|
|
||||||
* [Data Collection Methods](/courses/ucp-science/data-collection)
|
* [Data Collection Methods](/courses/ucp-science/data-collection)
|
||||||
* Population Trait Data Counter
|
* [Population Trait Data Counter](/courses/ucp-science/population)
|
||||||
* Temperature Data
|
* Temperature Data
|
||||||
* Soil Moisture Tester
|
* Soil Moisture Tester
|
||||||
* Body Electrical & Waves
|
* Body Electrical & Waves
|
||||||
|
17
docs/courses/ucp-science/body-electrical.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# Body electrical and waves
|
||||||
|
|
||||||
|
![Body electrical waves graph](/static/courses/ucp-science/body-electrical/body-waves.jpg)
|
||||||
|
|
||||||
|
Electrical impulses in the body can be observed, measured, and recorded as waves to show that there is a relationship between the circulatory, respiratory, muscular, and nervous systems. The @boardname@ can measure and record these waves, then send them to a to another @boardname@ which serves as the data collection device. The data can then be downloaded and anaylzed in a spreadsheet.
|
||||||
|
|
||||||
|
## Contents
|
||||||
|
|
||||||
|
* [Overview](/courses/ucp-science/body-electrical/overview)
|
||||||
|
* [Setup and procedure](/courses/ucp-science/body-electrical/setup-procedure)
|
||||||
|
* [Resources](/courses/ucp-science/body-electrical/resources)
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
| | | |
|
||||||
|
|-|-|-|
|
||||||
|
| Adapted from "[Body Electrical & Waves](https://drive.google.com/open?id=1KofuOt0v1lmQhQyJux1XWDVoCDeslcjDFysjStFmo1w)" 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/) |
|
46
docs/courses/ucp-science/body-electrical/overview.md
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
# Overview
|
||||||
|
|
||||||
|
## Science Concept
|
||||||
|
|
||||||
|
### The Nervous System Communicates with Muscles through Electrical Waves
|
||||||
|
|
||||||
|
Electrical impulses from the brain to the muscles can be observed, measured, and recorded as waves to show that there is a relationship between the circulatory, respiratory, muscular, and nervous systems of the human body.
|
||||||
|
|
||||||
|
#### Sample micro:bit body electrical data graph
|
||||||
|
|
||||||
|
![Graph of body electrical waves](/static/courses/ucp-science/body-electrical/body-electrical-waves.jpg)
|
||||||
|
|
||||||
|
## Project Goal
|
||||||
|
|
||||||
|
Give students real world experience with coding, collecting data, analyzing data, and reporting results using [MakeCode’s](https://makecode.com) block programming and a [micro:bit](http://microbit.org) with its sensors.
|
||||||
|
|
||||||
|
## Prior Knowledge
|
||||||
|
|
||||||
|
Students need to have a basic knowledge of how to code using block style programming (micro:bit using the Windows 10 MakeCode app) and download a program to a @boardname@.
|
||||||
|
|
||||||
|
## Student Outcomes
|
||||||
|
|
||||||
|
Students will:
|
||||||
|
|
||||||
|
* Create experiments to collect data using @boardname@s and measure voltage in the human body.
|
||||||
|
* Setup different experiments to observe the bodies electrical effect.
|
||||||
|
* Code the @boardname@s to collect data remotely over the @boardname@ radios.
|
||||||
|
* Analyze the data collected.
|
||||||
|
* Report on the findings of the experiments.
|
||||||
|
|
||||||
|
## Materials Needed
|
||||||
|
|
||||||
|
* 2 @boardname@s with batteries connected
|
||||||
|
|
||||||
|
![Two micro:bits together](/static/courses/ucp-science/body-electrical/two-microbits.jpg)
|
||||||
|
|
||||||
|
* A longer USB microbit cable
|
||||||
|
* Spreadsheet for data analysis
|
||||||
|
* 2 long (36-48” or 100-130 cm) thin wires for electrical body sensors (wire from an old network cable works quite well).
|
||||||
|
* Painters tape to tape the wires to the skin on the body.
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
| | | |
|
||||||
|
|-|-|-|
|
||||||
|
| Adapted from "[Body Electrical & Waves](https://drive.google.com/open?id=1KofuOt0v1lmQhQyJux1XWDVoCDeslcjDFysjStFmo1w)" 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/) |
|
87
docs/courses/ucp-science/body-electrical/resources.md
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
# 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.
|
||||||
|
|
||||||
|
#### Networks & the Internet
|
||||||
|
|
||||||
|
* 04 — Model the role of protocols in transmitting data across networks and the Internet.
|
||||||
|
|
||||||
|
#### 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.
|
||||||
|
* 12 — Design and iteratively develop programs that combine control structures, including nested loops and compound conditionals.
|
||||||
|
* 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,
|
||||||
|
|
||||||
|
## 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)
|
||||||
|
|
||||||
|
## NGSS - Utah SEEd
|
||||||
|
|
||||||
|
### Strand 6.4: Stability and Change in Ecosystems
|
||||||
|
|
||||||
|
* Standard 6.4.3
|
||||||
|
|
||||||
|
>Develop a model to describe the cycling of matter and flow of energy among living and nonliving parts of an ecosystem...
|
||||||
|
|
||||||
|
### Strand 7.1: Forces are Interactions between Matter
|
||||||
|
|
||||||
|
* Standard 7.1.3
|
||||||
|
|
||||||
|
>Construct a model using ...the cause and effect relationship between properties of objects (such as ...electrically-charged objects)....
|
||||||
|
|
||||||
|
* Standard 7.1.4
|
||||||
|
|
||||||
|
>Collect and analyze data to determine the factors that affect the strength of electric ... forces…
|
||||||
|
|
||||||
|
### Strand 7.3: Structure and Function of Life
|
||||||
|
|
||||||
|
* Standard 7.3.3
|
||||||
|
|
||||||
|
>Construct an explanation using evidence to explain how body systems have various levels of organization. Emphasize understanding that cells form tissues, tissues form organs, and organs form systems specialized for particular body functions. Examples could include relationships between the circulatory, ....respiratory, muscular, ... and nervous systems. ...
|
||||||
|
|
||||||
|
### Strand 8.2: Energy is Stored and Transferred in Physical Systems
|
||||||
|
|
||||||
|
* Standard 8.2.4
|
||||||
|
|
||||||
|
>Use computational thinking to describe a simple model for waves that shows the pattern of wave amplitude being related to wave energy (the brain sends electrical signal to the body and muscles in a wave format). Emphasize describing waves with both quantitative and qualitative thinking. Examples could include using graphs, charts, computer simulations, or physical models to demonstrate amplitude and energy correlation.
|
||||||
|
|
||||||
|
* Standard 8.2.6
|
||||||
|
|
||||||
|
>Obtain and evaluate information to communicate the claim that the structure of digital signals are a more reliable way to store or transmit information than analog signals. Emphasize the basic understanding that waves can be used for communication purposes. Examples could include using vinyl record vs. digital song files, film cameras vs. digital cameras, or alcohol thermometers vs. digital thermometers.
|
||||||
|
|
||||||
|
## 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 "[Body Electrical & Waves](https://drive.google.com/open?id=1KofuOt0v1lmQhQyJux1XWDVoCDeslcjDFysjStFmo1w)" 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/) |
|
133
docs/courses/ucp-science/body-electrical/setup-procedure.md
Normal file
@ -0,0 +1,133 @@
|
|||||||
|
# Setup and procedure
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
1. Plan and design the experiments.
|
||||||
|
2. Connect the wires to the microbit with connections at pin **0** and the ground pin (**GND**). Pin **0** will detect any electrical current flowing between it and the ground. The human body is always sending out electrical current from the nervous system to the muscles.
|
||||||
|
3. Coil the stripped ends of the copper wires and tape them to the skin in different areas of the body with the painters tape.
|
||||||
|
4. Plan and design data collection documents.
|
||||||
|
5. Program the @boardname@s.
|
||||||
|
6. Experiment with different data collections scenarios (this experiment could try several different areas of the body. It could also monitor the body sitting or during movements or exercise to observe any differences).
|
||||||
|
7. Report on the findings and observations in the experiments.
|
||||||
|
|
||||||
|
![Micro:bit connected to body wires](/static/courses/ucp-science/body-electrical/body-wires-connect.jpg)
|
||||||
|
|
||||||
|
## Code and data collection
|
||||||
|
|
||||||
|
This project will use to microbits to collect and record data using the Windows 10 MakeCode app as described in the [Data Collection](/courses/ucp-science/data-collection/setup-procedure) lesson.
|
||||||
|
|
||||||
|
## Option 2 — Microbit Windows 10 MakeCode app and a USB connection
|
||||||
|
|
||||||
|
The Windows 10 MakeCode app allows data to be directly read from the microbit when it is attached using USB cable. Data can be sent from the microbit to the Windows 10 MakeCode app using serial data connection. The data collected over the serial connection can be graphed and the data can be downloaded. A limit of only about the last 20 seconds of data can be downloaded as a ``"data.csv"`` file. This allows the collection of data in real time. This file can be opened in a spreadsheet for further analysis. Many different kinds of experiments can be performed using this data logging technique.
|
||||||
|
|
||||||
|
### on Start event
|
||||||
|
|
||||||
|
1. Code the first @boardname@ using Windows 10 MakeCode app for @boardname@.
|
||||||
|
2. Name the project, "Body Electricity Sender".
|
||||||
|
3. The ``||basic:on start||`` event will display the title and function of the @boardname@ in all caps, ``"BODY ELECTRICAL"``.
|
||||||
|
4. Set up a variable ``ekg`` or ``bodyElectricity`` and initialize its starting value to `0`.
|
||||||
|
|
||||||
|
### forever event
|
||||||
|
|
||||||
|
1. Set the ``ekg`` or ``bodyElectricity`` variable to get its value from the “analog read pin (0)”. This detects and electrical current that is sent through the body between the 2 taped wires connected to the body and the microbit. This is an analog reading that gets converted to a digital number between 0 - 1024.
|
||||||
|
2. The next line uses a ``||basic:serial write value||`` (``"EKG"`` and the value stored in the ``ekg`` variable) to send the value back to the Windows 10 MakeCode app through the USB connection to the computer and @boardname@.
|
||||||
|
|
||||||
|
```blocks
|
||||||
|
// Body Electricity
|
||||||
|
let ekg = 0
|
||||||
|
basic.showString("EKG")
|
||||||
|
|
||||||
|
// forever loop reading data on pin(0)
|
||||||
|
basic.forever(() => {
|
||||||
|
ekg = pins.analogReadPin(AnalogPin.P0)
|
||||||
|
serial.writeValue("EKG", ekg)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### Analyze
|
||||||
|
|
||||||
|
Here's a sample of some of the graphed data:
|
||||||
|
|
||||||
|
![Sample of data graphed in the data view](/static/courses/ucp-science/body-electrical/sample-graph.jpg)
|
||||||
|
|
||||||
|
Download the data collected and observed using the purple **Download** button.
|
||||||
|
The same data from the ``"data.csv"`` file might look like this in a spreadsheet:
|
||||||
|
|
||||||
|
![View of EKG data in spreadsheet](/static/courses/ucp-science/body-electrical/spreadsheet-view.jpg)
|
||||||
|
|
||||||
|
Do some more meaurements:
|
||||||
|
|
||||||
|
1. Try graphic the data in different ways in the spreadsheet.
|
||||||
|
2. Try collecting data for another area on the body.
|
||||||
|
|
||||||
|
## Option 3 — Remote radio collecting to receiving radio displaying
|
||||||
|
|
||||||
|
Two @boardname@s can be used to collect and record data using the radio commands. One @boardname@ can be setup remotely and the other @boardname@ can be used to observe the data. The first @boardname@ can send the data it observes to the second @boardname@ for the observer to record. To set up 2 @boardname@s so they can communicate over the radio they need to be on the same radio group. For additional information look at the [Data Collection](/courses/ucp-science/data-collection/setup-procedure) lesson.
|
||||||
|
|
||||||
|
By using 2 @boardname@ to collect the data on one and send it to the second @boardname@ which is connect to the Windows 10 MakeCode app using a USB cable the experiment can collect and record data remotely. This would allow the collection of body electrical data while a person is exercising or moving.
|
||||||
|
|
||||||
|
### micro:bit radio sending code
|
||||||
|
|
||||||
|
This sender @boardname@ uses the ``||basic:on start||`` event to set up the title on the @boardname@ when started, the radio group, and the ``bodyElectricity`` variable so it can collect and store the data received from the pin **0**.
|
||||||
|
|
||||||
|
The ``||basic:forever||`` event read the electricity on pin **0** and stores it in the variable ``bodyElectricity``. It's then sent over the radio to the receiver @boardname@.
|
||||||
|
|
||||||
|
```blocks
|
||||||
|
// Body Electricity Project
|
||||||
|
basic.showString("EKG")
|
||||||
|
let bodyElectricty = 0
|
||||||
|
radio.setGroup(99)
|
||||||
|
|
||||||
|
// forever loop that collects body electricity and send it over the radio
|
||||||
|
basic.forever(() => {
|
||||||
|
bodyElectricty = pins.analogReadPin(AnalogPin.P0)
|
||||||
|
radio.sendNumber(bodyElectricty)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### micro:bit radio receiving code
|
||||||
|
|
||||||
|
This receiver @boardname@ uses the “on start” event to set up the title on the @boardname@ when started, the radio group, and the ``bodyElectricity`` variable to collect and store the data received.
|
||||||
|
|
||||||
|
The ``||radio:on radio received||`` event reads the number value sent from the sending @boardname@. The number is then stored in the ``bodyElectricity`` variable. the electricity on pin **0** and stores it in the variable ``bodyElectricity``. The last line uses the serial write command to send the text `"Body Electricity"` label and the value of ``bodyElectricity`` variable back to the Windows 10 MakeCode app. The data is sampled and send from 10 to 20 times per second.
|
||||||
|
|
||||||
|
```blocks
|
||||||
|
// Body Electricity Receiver
|
||||||
|
basic.showString("BODY ELEC")
|
||||||
|
let bodyElectricty = 0
|
||||||
|
radio.setGroup(99)
|
||||||
|
|
||||||
|
// Radio Receiver event
|
||||||
|
radio.onDataPacketReceived( ({ receivedNumber }) => {
|
||||||
|
bodyElectricty = receivedNumber
|
||||||
|
serial.writeValue("Body Electricty", bodyElectricty)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
## Questions
|
||||||
|
|
||||||
|
1. Can you observe relationships with a heart rate? With breathing?
|
||||||
|
2. Is there a difference when connected to muscle and skin with limited muscles underneath?
|
||||||
|
3. When is the strength of the signal stronger?
|
||||||
|
4. What is the relationship between the analog reading and the digital output?
|
||||||
|
5. In a spreadsheet, does graphing few seconds compared to several seconds give a different picture of what is happening?
|
||||||
|
|
||||||
|
## Extensions
|
||||||
|
|
||||||
|
### Monitoring Exercise
|
||||||
|
|
||||||
|
Set up the experiment to collect data while someone is exercising.
|
||||||
|
|
||||||
|
### Develop other hypotheses and experiments
|
||||||
|
|
||||||
|
Research what about EKG and other body electrical signals.
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
|
||||||
|
| | | |
|
||||||
|
|-|-|-|
|
||||||
|
| Adapted from "[Body Electrical & Waves](https://drive.google.com/open?id=1KofuOt0v1lmQhQyJux1XWDVoCDeslcjDFysjStFmo1w)" 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/) |
|
||||||
|
|
||||||
|
```package
|
||||||
|
radio
|
||||||
|
```
|
@ -15,11 +15,12 @@ Give students real world experience with coding, collecting data, analyzing data
|
|||||||
|
|
||||||
## Prior Knowledge
|
## Prior Knowledge
|
||||||
|
|
||||||
Students need to have a basic knowledge of how to code using block style programming (micro:bit using the Windows 10 MakeCode app) and download a program to a micro:bit.
|
Students need to have a basic knowledge of how to code using block style programming (micro:bit using the Windows 10 MakeCode app) and download a program to a @boardname@.
|
||||||
|
|
||||||
## Student Outcomes
|
## Student Outcomes
|
||||||
|
|
||||||
Students will:
|
Students will:
|
||||||
|
|
||||||
* Create experiments to collect data using micro:bits and the pins to measure electrical voltage.
|
* Create experiments to collect data using micro:bits and the pins to measure electrical voltage.
|
||||||
* Setup different experiments to observe the electricity, voltage, and other electrical effects.
|
* Setup different experiments to observe the electricity, voltage, and other electrical effects.
|
||||||
* Code the micro:bits to collect data.
|
* Code the micro:bits to collect data.
|
||||||
|
15
docs/courses/ucp-science/population.md
Normal 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/) |
|
BIN
docs/courses/ucp-science/population/microbit-display.jpg
Normal file
After Width: | Height: | Size: 32 KiB |
43
docs/courses/ucp-science/population/overview.md
Normal 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 person’s 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/) |
|
48
docs/courses/ucp-science/population/resources.md
Normal 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/) |
|
120
docs/courses/ucp-science/population/setup-procedure.md
Normal 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/) |
|
BIN
docs/static/courses/ucp-science/body-electrical/body-electrical-waves.jpg
vendored
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
docs/static/courses/ucp-science/body-electrical/body-waves.jpg
vendored
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
docs/static/courses/ucp-science/body-electrical/body-wires-connect.jpg
vendored
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
docs/static/courses/ucp-science/body-electrical/sample-graph.jpg
vendored
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
docs/static/courses/ucp-science/body-electrical/spreadsheet-view.jpg
vendored
Normal file
After Width: | Height: | Size: 58 KiB |
BIN
docs/static/courses/ucp-science/body-electrical/two-microbits.jpg
vendored
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
docs/static/courses/ucp-science/population/microbit-display.jpg
vendored
Normal file
After Width: | Height: | Size: 20 KiB |