outline of milkjmonster lesson (#372)

* outline of milkjmonster lesson

* Inital version Milky Monster ready to publish on Github - can you please review Peli ?

* removing "radio" project

* various fixes

* updated summary

* Adding croc to male option

* commit changes

* fixed missing pdf

* fixing broken image link

* fixing servo page

* fixing markdown

* Fixing step1

* commit changes

* merging

* merge

* changed milk-monster to milky-monster

* reized image
This commit is contained in:
Peli de Halleux
2017-03-20 15:17:24 -07:00
committed by GitHub
parent 0025f7bf44
commit f041324388
19 changed files with 305 additions and 90 deletions

View File

@ -0,0 +1,56 @@
# Milk monster
### @description A milky-monster like robot built with the @boardname@
### ~avatar avatar
Make a funny milky-monster robot!
### ~
https://youtu.be/egl3fNAYylk
## Duration
3 Activities, approx 30-45 min each based on familiarity with the coding concepts
## Materials
Recycled
* 1 Milk Carton (with a screwable top cap)
* 1 Small cord - recylce string from a used tea bag
* 1 Paper clip
Electronics
* 1 @boardname@, battery holder and 2 AAA batteries
* 3 Crocodile clips
* 1 micro servo 9g SG90
* 1 servo clip designed for Milky Monster [download on thingiverse](http://www.thingiverse.com/thing:2185971) (optional). Teachers may prefer to download the classroom pack (16 servo clips).
Tools
* Small knive and Scissors that can cut cardboard
* Tape (masking, duct tape, and/or packing tape)
* Glue gun
![Materials](/static/mb/projects/milky-monster/materials.jpg)
## Preparation
* [Equip the microservo with crocodile clips](/device/servo)
* [Download and 3D-print servo clip designed for MIlky Monster from thingiverse](http://www.thingiverse.com/thing:2185971) (this is optional). Teachers may prefer to download the classroom pack (16 servo clips).
## Activities
* [Make](/projects/milky-monster/make)
* [Code](/projects/milky-monster/code)
* [Connect](/projects/milky-monster/connect)
### ~button /projects/milky-monster/make
Let's get started!
### ~
## about the author
This project was contributed by Peter Heldens [@peterheldens](https://twitter.com/peterheldens). You can checkout his [@boardname@ makershow channel on youtube](http://aka.ms/microbit-makershow) for more projects.

View File

@ -0,0 +1,83 @@
# Code
### @description code to make the Milky Monster alive
### ~avatar avatar
Add code to make the Milky Monster move.
### ~
## Duration: ~30 minutes
## Step 1: calibrate servo
In order for the Milky Monster to move, the @boardname@ needs to command the servo to go between ``0`` and ``180`` degrees at a certain pace. In the code below:
- the user pressed button ``A`` to switch the servo to 180 degrees (to close the mouth of Milky Monster).
- the user pressed button ``B`` to switch the servo to 0 degrees (to open the mouth of Milky Monster).
```blocks
input.onButtonPressed(Button.A, () => {
pins.servoWritePin(AnalogPin.P0, 180)
basic.showNumber(180)
})
input.onButtonPressed(Button.B, () => {
pins.servoWritePin(AnalogPin.P0, 0)
basic.showNumber(0)
})
basic.showString("calibrate")
```
## Step 2: attach rotor
The servo should be positioned on 180 degrees **before** attaching the rotor to it. This is to make sure the mouth of the Milky Monster will be closed once the servo reaches 180 degrees.
### ~ hint
You may use a philips scew driver to attach the rotor to the servo.
### ~
https://youtu.be/YZfkMWTeH4o
## Step 3: check calibration
When the user pressed ``A`` the servo rotor should be in 'up' position.
https://youtu.be/bAqXEawUsSM
## Step 4: connect cord to rotor
Connect the cord to the servo rotor while mouth of Milky Monster is **closed**.
https://youtu.be/AWsnwk_iA_A
## Step 5: connect cables to @boardname@
Connect cables from @boardname@ to the servo and place the battery.
https://youtu.be/fAR58GJUZdM
## Step 6: code light sensor
Code the lightsensor on the @boardname@ to control the servo.
```blocks
basic.forever(() => {
pins.servoWritePin(AnalogPin.P0, input.lightLevel())
led.plotBarGraph(
input.lightLevel(),
0
)
})
```
## Step 6: Ready!
Your Milky Monster is ready!
https://youtu.be/egl3fNAYylk
### ~button /projects/milky-monster/connect
NEXT: Connect
### ~

View File

@ -0,0 +1,28 @@
# Connect
### ~avatar avatar
Remote control your Milky Monster with another @boardname@
### ~
## Duration: ~30 minutes
You will need 2 @boardname@ for this part. By using the radio, we can make the Milky Monster controlled by another @boardname@.
Download the code below to the @boardname@ on the Milky Monster and another "controller" @boardname@. Whenere A is pressed, the Milky Monster will move once.
```blocks
radio.onDataPacketReceived(({receivedNumber}) => {
pins.servoWritePin(AnalogPin.P0, 0)
basic.pause(500)
pins.servoWritePin(AnalogPin.P0, 180)
basic.pause(500)
})
input.onButtonPressed(Button.A, () => {
radio.sendNumber(0)
})
```
```package
radio
```

View File

@ -0,0 +1,115 @@
# Make
### @description Building the cardboard Milky Monster
### ~avatar avatar
Turn a piece of cardboard into an milky-monster!
### ~
## Duration: ~45 minutes
## Materials
#### Recycled
* 1 Milk Carton (with a screwable top cap)
* 1 Small cord - recycle string from a used tea bag
* 1 Paper clip
### Electronics
* 1 @boardname@, battery holder and 2 AAA batteries
* 3 Crocodile clips
* 1 micro servo 9g SG90
* 1 servo clip designed for Milky Monster [download on thingiverse](http://www.thingiverse.com/thing:2185971) (optional). Teachers may prefer to download the classroom pack (16 servo clips).
### Tools
* Small knive and Scissors that can cut cardboard
* Tape (masking, duct tape, and/or packing tape)
* Glue gun
## Step 1: download and cut the template
[Download the Milky Monster template](/static/mb/projects/milky-monster/MilkyMonsterTemplate.pdf) and cutout the template.
https://youtu.be/ipsZuFNgTHM
## Step 2: glue template on milk carton
Glue the template on the milk carton.
https://youtu.be/2D3WFp29QC4
## Step 3: cut carton
Cut the carton (watch the fingers!)
https://youtu.be/pvC3Tnhe5QU
## Step 4: create mouth
Cut the cardboard halfways and fold the corners. This will be the mouth of the Milky Monster.
https://youtu.be/Yyk1zW4sFoM
## Step 5: extend mouth
Use tape to extend the mouth approx 1 cm. Fold one after the other.
https://youtu.be/RWJbqI03wPE
## Step 6: connect cord
Using scissors, create a small whole to insert the cord. Tape the cord on the backsite of the mouth.
![](/static/mb/projects/milky-monster/connectmouth.jpg)
Once finished position the mouth in upward position and fix the cord between the cap.
https://youtu.be/Qyndcsmt0AU
## Step 7: create space for @boardname@
Use scissors to create space at the bottom of the Milky Monster to attach the @boardname@.
https://youtu.be/3FUNI0GSbNc
## Step 8: Create space for cables
Create space to route the cables nicely on back of the milky-monster.
https://youtu.be/BoIRCk769MM
## Step 9: attaching clip to servo
Use a philips screw driver to mount the servo to the 3D-printed servo clip.
If you don't have the 3D-printed clips available, [download on thingiverse](http://www.thingiverse.com/thing:2185971) , or fix the servo using tyraps or a glue gun.
https://youtu.be/drKzo5zqvuI
## Step 10: attaching servo to milk button
Glue servo to the cap of the milk carton.
https://youtu.be/Ch_vU5LXPeM
## Step 11: cutout hole in cap
Cutout a hole in the cap to guide the string to the servo.
https://youtu.be/Ch_vU5LXPeM
## Step 12: connect crocodile clips
Connect the crocodile clips to the servo.
https://youtu.be/RiQE-9z9LrI
## Step 11: it's ready!
Your milky-monster is ready!
![](/static/mb/projects/milky-monster/ready.jpg)
### ~button /projects/milky-monster/code
NEXT: Code
### ~

View File

@ -1,68 +0,0 @@
# radio
Measure the acceleration on the @boardname@ in the "x" direction.
### ~avatar avatar
Welcome! This activity will teach how to use the @boardname@ to chart the acceleration in the "x" direction. Let's get started!
### ~
Let's measure `acceleration (mg)` in the "x" direction. Get the acceleration value (milli g-force), in one of three specified dimensions.
```blocks
input.acceleration(Dimension.X)
```
### ~
Use the plot bar chart to visualize the acceleration on the LED screen of the @boardname@ in the specified range. You implement plot Bar Graph to display a vertical bar graph based on the "value" and "high" value. Then you must insert acceleration in the X dimension to measure the acceleration.
```blocks
basic.forever(() => {
led.plotBarGraph(input.acceleration(Dimension.X), 0)
})
```
### ~
Notice that moving the @boardname@ in the simulator from left to right (x direction) changes the values beneath the @boardname@ in a range from 1023 to -1023 as measured in milli-gravities. By hovering over the @boardname@ from left to right, you can observe changing values beneath the @boardname@ simulator. Also, the LEDs shown on the Bar Graph fluctates based on the movement of the @boardname@ simulator in the x direction. The line underneath the @boardname@ simulator reflect the acceleration in the x direction.
NOTE: The colors of the charts reflect the color of the @boardname@ simulator. In this instance, the @boardname@ is yellow. So the color of the data line reflects the color of the @boardname@
![](/static/mb/data4.png)
### ~
Vigorously move the @boardname@ in the @boardname@ simulatator by moving the @boardname@ image from side to side. Every time the @boardname@ moves in the x direction in the simulator, you are generating data points that can be reviewed in Excel. The more attempts to move the @boardname@ from side to side, the more data being saved in Excel. After you have vigarously moved the @boardname@ simulator from side to side for a sufficient amount of time, you are ready to graph or chart the accceleration of the @boardname@. We want a printout of our acceleration on Excel that can be graphed in Excel.
### ~
We want to chart the data collected by using a tool in Excel.
The final part of this experiment is opening and reviewing the data in the Excel CSV file. Simply click on the line beneath the simulator. A CSV file will be generated to display the data points collected by moving the @boardname@ in the X direction. Then click or tap on the data Excel file that was downloaded to your local ``Downloads`` Folder.
### ~
First, click or tap on the first two columns (A, B) to include the time of the data being collected; b) the results of acceleration data on the @boardname@
![](/static/mb/data7.png)
Use the Recommended Charts command on the Insert tab to quickly create a chart thats just right for your data.
* Select the data that you want to include in your chart.
* Click Insert > Recommended Charts.
![](/static/mb/lessons/chart1.png)
* On the Recommended Charts tab, scroll through the list of chart types that Excel recommends for your data. Pick the **scatter plot**.
### ~avatar avatar
Excellent, you're ready to continue with the [challenges](/projects/radio-challenges)
### ~