微軟 micro:bit 創意課程系列--Milk Carton Robot
2017-10-09 10:24微軟 micro:bit 創意課程系列--Milk Carton Robot
做一個有趣的牛奶紙箱機器人!
Duration
持續時間
3活動,約30-45分鐘,每個基於熟悉編碼概念
Materials
物料
回收
•1個不含可旋蓋帽的牛奶紙箱
•2個咖啡燒木棍
•2只稻草
•2個晾衣架(可選,可由膠水代替)
電子產品
•1微:位,電池座和2節AAA電池
•3條鱷魚夾子,用於引出電纜
•1微伺服9g SG90
工具
•可剪切紙板的剪刀
•打孔機(剪刀也會工作)
• 膠槍
Preparation
Activities
Make
Turn a piece of cardboard into an milk carton robot!
Duration: ~45 minutes
Step 1: Cutting the lip
Step 2: Cutting the mouth
Step 3: Cutting the teeth
Step 4: Attaching the mouth
Step 5: Attaching the mouth wood sticks
Step 6: Mounting the servo
Step 7: Connecting the mouth to the servo
Well done! Let’s move to programming the micro:bit to move the mouth.
Code
Add code to make the Milk Carton Robot move.
Duration: ~15 minutes
Step 1: wire up the servo
Follow the instructions in servo 101 manual to connect the servo to the micro:bit.
Step 2: code light sensor
Code the lightsensor on the micro:bit to control the servo.
It works but your servo might be trying to move too much. Let’s calibrate it.
Step 3: calibrate the servo
Download the servo calibration program to determine to opening and closing angles of the servo for your robot.
我們將使用pins.map將光照範圍0,255映射到角度範圍,[關閉,打開]。
Connect
Remote control your Milk Carton Robot with another micro:bit
Duration: ~30 minutes
您將需要2x micro:bit這部分。 通過使用收音機,我們可以使Milk Carton Monster由另一個微處理器控制: 將下面的代碼下載到“牛奶紙箱怪物”上的micro:bit,另一個“控制器”micro:bit。 如果按A,牛奶紙箱怪物會動一次。
Microbit 中文 課程 : Python , Javascript, 物聯網
標籤:
—————