S1 Student Workbook Term 4 - CyberPi makeblock education S1 Student Workbook Term 4 Contents 1. Voting System Tools 1.1 Let's Make a VST (Voting System Tools) Exercise 1 2. Voting System Tools 2 2 5 6 2.1 Make a Block 6 Exercise 2 9 3. Artificial Intelligence 10 3.1 Artificial Intelligence 10 Exercise 3 13 4. Internet of Things 15 4.1 Internet of Things 15 Exercise 4 21 Term 4 Final Project 23 makeblock education indonesia makeblock education Lesson 1 Voting System Tools 1. 1 Let's make a VST (Voting System Tools) Let’s make traffic light with In this lesson, we will use CyberPi to form a LAN and then run a poll. And only we, in this classroom, can vote. So, how do we make a voting system with CyberPi and mBlock? First, we need an initiator to start a poll. Then, the rest of us will be voters. When the voting session closes, the initiator counts the votes. So, initiator will send out options, and voters will give vote, and initiator collect the votes and check the results, so right now we know the basic concept of VST. Then how’d we build this with mBlock 5? To build this system you need LAN, Timer, and Variable. makeblock education indonesia 2 makeblock education Intiator : makeblock education indonesia 3 makeblock education Voters : makeblock education indonesia 4 makeblock education Exercise 1 Name : Class : Create a group with 5 Students Objective : Initiate a group vote (Possible Subject: favorite song/movie/movie star/singer/game,etc) When the poll is done, the group should analyse the result. For example, have students figured out which is the most popular song? Class : Team Name : Team Member : 1. 2. 3. 4. 5. 1. What’s your team plan? .............................................................................................................................................. .............................................................................................................................................. .............................................................................................................................................. .............................................................................................................................................. .............................................................................................................................................. .............................................................................................................................................. .............................................................................................................................................. makeblock education indonesia 5 makeblock education Lesson 2 Make a Block 2.1 Make a Block When we write a program, sometimes we repeat some similar program and make it looked long. To simplify this problem, MBlock application provide block to create “duplicate program”or subroutine and call them “make a block”. In general, the “original calling program” is called “Main Program” and the “called program” is called “subroutine”. We can imagine “subroutine” as phone contact number. When we need to call someone, we can search for phone number based on contact name that we save. Subroutine has same process as phone contact number. We can pass “actual parameter” when call the subroutine, then it will use as “local parameter” in subroutine. When subroutine is done, the main program continue to next line program. Example : The program from the previous lesson is shortened and simplified using Make a Block Before makeblock education indonesia After 6 makeblock education Step to create a block : Function Make a new block using Data Command Create name of block (recommended to not use space or symbol). We can add some parameter like number, string, and boolean input. Result Block to call program makeblock education indonesia Block of subroutine 7 makeblock education Properties : Block Function Add parameter number input to block Add parameter string input to block Block Add parameter boolean input to block Add label text for name of block makeblock education indonesia 8 makeblock education Exercise 2 Name : Class : Evaluation Test: 1. What is Make a Block? 2. How to make a new block with "Make a Block" 3. Make a simple program using"Make a Block" makeblock education indonesia 9 makeblock education Lesson 3 Artificial Intelligence 3.1 Artificial Intelligence (AI) Artificial intelligence (AI), the ability of a digital computer or computer-controlled robot to perform tasks commonly associated with intelligent beings. The term is frequently applied to the project of developing systems endowed with the intellectual processes characteristic of humans, such as the ability to reason, discover meaning, generalize, or learn from past experience. CyberPi has an AI feature, CyberPi’s AI can to auto-recognize human speech and translate a language. Before you use AI feature, you need connect your CyberPi to the internet : Block makeblock education indonesia 10 makeblock education Block Function Recognizes the specified text and reads it out loud in the recognize language Recognizes the specified language for the specified period Function Report the words recognized in a speech Report the translation of the specified text makeblock education indonesia 11 makeblock education Example : 1. Compile the program in Upload mode, and upload it to CyberPi. Press button A and speak English, CyberPi displays the words recognized on its screen. Function Note : Set the Wi-Fi name and the password 2. Let’s add simple translator, Press button B, to translate English to Chinese makeblock education indonesia 12 2 makeblock education Exercise 3 Name : Class : Let's make an AI (Artificial Intelligence) project! Week 1 : Make a group with 5 Students Find a topic or an idea with your group Submit your project to your teacher Week 2 : Start make the project with your team You can use Smart camera and combine AI from mBlock 5 (sprites) Convert the block programming to python programming Make a presentation about your project Week 3 : Present your project in front of your class Class : Team Name : Team Member : 1. 2. 3. 4. 5. Your Topic or Idea : makeblock education indonesia 13 makeblock education makeblock education indonesia 14 makeblock education Lesson 4 IoT (Internet of Things) 4.1 Internet of Things The Internet of things (IoT) describes the network of physical objects—“things”—that are embedded with sensors, software, and other technologies for the purpose of connecting and exchanging data with other devices and systems over the Internet. In future, there will be intelligent applications for smarter homes and offices, smarter transportation systems, smarter hospitals, smarter enterprises and factories. IOT can provide several Block advantages in Retail and supply chain management (SCM) operations. makeblock education indonesia 15 makeblock education Block Lesson 4 Function Artificial Intelligence Sends the specified user cloud message Sends the specified user cloud message and the specified value Function Executes the subsequent block(s) when the specified user cloud message is received Reports the value received through the specified user cloud message Reports the specified weather condition of the specified district Reports the specified weather quality condition of the specified district makeblock education indonesia 16 makeblock education Example : Press button A to send a cloud message to CyberPi B When CyberPi B receive the cloud message, CyberPi B turn on a rainbow color and roll the LED light CyberPi A : Function CyberPi B : You can send cloud message to mBlock 5 sprite through “use cloud message”. But first, you need to make a mBlock 5 account or sign up to mblock 5 account. makeblock education indonesia 17 makeblock education Make a mBlock 5 Account 1. Click this Icon Below 2. Follow the on-interface instructions to sign up/sign in. 3. After signing in, you can manage or publish your projects, and use cloud services. makeblock education indonesia 18 makeblock education Block Function To send a data with name "message" to cloud To send a data with name "message" and has value "1" to cloud Will run the command when receiving message “message” from cloud Send the value of the message "message" from cloud makeblock education indonesia 19 makeblock education Example : When panda is clicked, send cloud message with name “message” to make CyberPi plays sound “Hi” Sprite : CyberPi : makeblock education indonesia Function 20 2 makeblock education Exercise 4 Name : Class : Let's make an IoT (Internet of Things) project! Week 1 : Make a group with 5 Students Find a topic or an idea with your group Submit your project to your teacher Week 2 : Start make the project with your team Convert the block programming to python programming Make a presentation about your project Week 3 : Present your project in front of your class Class : Team Name : Team Member : 1. 2. 3. 4. 5. Your Topic or Idea : makeblock education indonesia 21 makeblock education makeblock education indonesia 22 makeblock education Term 4 Final Project Name : Class : You finished the lesson module, now make a final project from the things you have learned. Week 1 : Please make a group with 5 students, discuss the idea and topic with your team, and submit the topic to your teacher ! You can combine CyberPi with mBot, smart camera, and some extensions from mBlock 5 (sprites) to make your project unique Start make the project with your team Convert the block programming to python programming Make a presentation and engineering note book about your project Final Week : Present your project in front of your class Class : Team Name : Team Member : 1. 2. 3. 4. 5. makeblock education indonesia 23 makeblock education Engineering Note Book 1. Information Team Name Team Captain Futurist Team Number Team Member Team Slogan 2. Project Introduction 3. Division of Labor Engineer : Programmer : Problem solver : Mechanical : Wiring : 4. Production Schedule 5. Design Inspiration 6. Technical Principle 7. Building Process 8. Challenges & Solutions 9. Anything you want to say makeblock education indonesia 24 makeblock education makeblock education indonesia 25 makeblock education E N D of term 4