m-block By Wilmer Arellano

Similar documents
m-block By Wilmer Arellano

mbot v1.1 - Blue (Bluetooth Version)

Lab 01 Arduino 程式設計實驗. Essential Arduino Programming and Digital Signal Process

Quick Guide WARNING: CHOKING HAZARD - Small parts. Not for children under 3 years old. mbot is an educational robot kit for beginners to get hands-on

Intel Do-It-Yourself Challenge Lab 1: Intel Galileo s Arduino side Nicolas Vailliet

Arduino 101 AN INTRODUCTION TO ARDUINO BY WOMEN IN ENGINEERING FT T I NA A ND AW E S O ME ME NTO R S

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

TA0139 USER MANUAL ARDUINO 2 WHEEL DRIVE WIRELESS BLUETOOTH ROBOT KIT

PiKoder/SSC RX. User s Guide. Version 1.0b dated 11/01/16. Gregor Schlechtriem

StenBOT Robot Kit. Stensat Group LLC, Copyright 2018

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Arduino

Arduino Programming and Interfacing

ROBOTLINKING THE POWER SUPPLY LEARNING KIT TUTORIAL

Intel Do-It-Yourself Challenge Hello World with the Arduino IDE Nicolas Vailliet

Schedule. Sanford Bernhardt, Sangster, Kumfer, Michalaka. 3:10-5:00 Workshop: Build a speedometer 5:15-7:30 Dinner and Symposium: Group 2

Imperativ Programming. morning (again) Jens Dalsgaard Nielsen Aalborg University (1/24)

Arduino Programming. Arduino UNO & Innoesys Educational Shield

Counter & LED (LED Blink)

ISL RGB Sensor Tutorial By: Sabrina Jones

Mi Home Security Camera Connection Guide. (ios)

WiFiBee MT7681 (Arduino WiFi Wireless Programming) SKU: TEL0107

Introduction to Processing

Prototyping & Engineering Electronics Kits Basic Kit Guide

Designed & Developed By: Ms. Jasleen Kaur, PhD Scholar, CSE. Computer Science & Engineering Department

Electronic Brick Starter Kit

Robotics and Electronics Unit 5

Halloween Pumpkinusing. Wednesday, October 17, 12

More Arduino Programming

Arduino Part 2. Introductory Medical Device Prototyping

3.The circuit board is composed of 4 sets which are 16x2 LCD Shield, 3 pieces of Switch, 2

Serial.begin ( ); Serial.println( ); analogread ( ); map ( );

Introduction to Internet of Things Prof. Sudip Misra Department of Computer Science & Engineering Indian Institute of Technology, Kharagpur

EXPERIMENT 7 Please visit to learn all features of arduino before you start the experiments

mblock Robotics Advanced Programs

SPLDuino Programming Guide

keyestudio Keyestudio MEGA 2560 R3 Board

Digital Pins and Constants

Arduino Uno. Power & Interface. Arduino Part 1. Introductory Medical Device Prototyping. Digital I/O Pins. Reset Button. USB Interface.

Introduction To Arduino

A Toolkit to Learn Algorithmic Thinking using mbot Robot

Intel Do-It-Yourself Challenge Maestro Pololu card + Bluetooth

TABLE OF CONTENTS INTRODUCTION LESSONS PROJECTS

The DTMF generator comprises 3 main components.

CTEC 1802 Embedded Programming Labs

Lab 1: Introductory Project to Breadware

User-defined Functions Case study

Smart Objects. SAPIENZA Università di Roma, M.Sc. in Product Design Fabio Patrizi

EEG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

Arduino Prof. Dr. Magdy M. Abdelhameed

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

USER MANUAL ARDUINO I/O EXPANSION SHIELD

Beginning. Learning Objectives

T-Scratch Basics. Coding with IDE (Software)

Robotics/Electronics Review for the Final Exam

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Programming Manual of MYOSA

Fall Harris & Harris

Create your own wireless motion sensor with

Sten-SLATE ESP Kit. Description and Programming

AndyMark Arduino Tutorial

Lesson 5: LDR Control

Digital Design through. Arduino

ARDUINO. By Kiran Tiwari BCT 2072 CoTS.

Arduino notes IDE. Serial commands. Arduino C language. Program structure. Arduino web site:

Introduction to Arduino

Makeblock Co., Ltd. D

CONSTRUCTION GUIDE Remote Big Wheel. Robobox. Level VIII

EL Sequencer/Escudo Dos Hookup Guide

TA0297 WEMOS D1 R2 WIFI ARDUINO DEVELOPMENT BOARD ESP8266

DFRobot BLE4.1 Module SKU: TEL0120

INTERMEDIATE PROGRAMMING LESSON

The Big Idea: Background:

Lab 2 - Powering the Fubarino. Fubarino,, Intro to Serial, Functions and Variables

Station Automation --W3SZ

Lesson 8: Digital Input, If Else

TOSR14x. TOSR14x USB/Wireless Relay Module. User Manual. Tinysine 2015 Version 1.2

RoastLogger Arduino/TC4 driver installation for Windows 9/10/13 By John Hannon (JackH) at Homeroasters.org

1.0. Presents. techathon 3.0

FireBeetle ESP8266 IOT Microcontroller SKU: DFR0489

Arduino Robotic Car. The result is a low cost and effective project for the Union Pacific Railroad grant.

LinkIt ONE. Introduction. Specifications

Introduction What is MIT App Inventor?

FTDI SmartBasic Hookup Guide

ArdOS The Arduino Operating System Quick Start Guide and Examples

Clark College Electrical Engineering & Computer Science

Coding Workshop. Learning to Program with an Arduino. Lecture Notes. Programming Introduction Values Assignment Arithmetic.

Intel Do-It-Yourself Challenge Intel Galileo and Edison Paul Guermonprez

Arduino Uno Microcontroller Overview

Specification. 1.Power Supply direct from Microcontroller Board. 2.The circuit can be used with Microcontroller Board such as Arduino UNO R3.

Lab 8. Communications between Arduino and Android via Bluetooth

AlphaBot2 robot building kit for Arduino

WALT: definition and decomposition of complex problems in terms of functional and non-functional requirements

THE COMPLETE ALL IN ONE ROBOT 360 NANO BOT

LAB PROCEDURE. Lab Objectives 1. Generate a project using the GR-Sakura web compiler 2. Edit/Compile/Build/Debug the project using the web compiler

Intel Do-It-Yourself Challenge Lab 5: Controlling Galileo from a webpage Nicolas Vailliet

Arduino Micro Breadboard Laboratory Interface Processor (Micro BLIP) User Manual

Update: Ver 1.3 Dec Arduino Learning Guide For Beginner Using. Created by Cytron Technologies Sdn Bhd - All Rights Reserved

Digital Devices in the Digital Technologies curriculum (F-10) Steve Allen VCAA Digital Coding Specialist Teacher

3. The circuit is composed of 1 set of Relay circuit.

Bluno Mega 2560 (SKU:DFR0323)

Transcription:

m-block By Wilmer Arellano

You are free: to Share to copy, distribute and transmit the work Under the following conditions: Attribution You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). Noncommercial You may not use this work for commercial purposes. No Derivative Works You may not alter, transform, or build upon this work.

With the understanding that: Public Domain Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. Other Rights In no way are any of the following rights affected by the license: Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; The author's moral rights; Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. Notice For any reuse or distribution, you must make clear to others the license terms of this work.

mbot mbot is an all-in-one solution for kids to enjoy the hands-on experience about programming, electronics, and robotics. Working with mblock inspired by Scratch 2.0, you can use Bluetooth or 2.4GHz wireless module to connect with mbot (By different version), this easy-to-assemble mbot

mbot Treat gently robot is fragile, specially additional modules (line follower, ultrasound, 2.4G, Bluetooth, etc.) and wheels

What is mcore? mcore is an easy-to-use main control board specially designed for mbot. Based on Arduino Uno, mcore integrates various onboard sensors, such as buzzer, light sensor, RGB LED, etc., which provides you an easier way to start learning electronics.

What is mcore?

mblock mblock is a graphical programming environment based on Scratch 2.0 Open Source Code that makes it easy to program Arduino projects and create interactive applications.

Tutorials Resources page Scratch Tutorial m-block Tutorial

Connect Your Robot Through USB Cables 1.use a USB cable to connect between your robot/controller board and your computer 2.make sure the robot is powered on (using the power switch) 3.select Connect, Serial Port, then the option corresponding to your robot. If you are using Windows, it should be something like COM and a number; if you are using a Mac, it starts like /dev/tty.wchusbserial. You may try different options if it does not works.

Programming Structure

Programming Structure

Play a Tone Example 1

Loading Programs to the Robot

Connect Your Robot Through 2.4G Modules In this mode, the program runs in the computer which sends instructions to the robot on the actions to perform. This is an interesting feature for applications as the remote control operation illustrated bellow. For most applications it is not the preferred way of operating the robot.

Connect Your Robot Through 2.4G Modules The 2.4G module set comes with a electronic module and a USB dongle. If your are using the dongle first time, you need to connect the 2.4G electronic module to your robot; power up your robot; press the button on top of the 2.4G module, and then plug the dongle to your computer. When the LED light on the module turns from blinking to steady lighting, it means the 2.4G module is paired with the dongle. On the software side, after pairing the dongle you need to select Connect- >2.4G Serial->Connect in the software menu. When Connected is shown in the title bar, you know your mbot is connected to the computer.

Connect Your Robot Through 2.4G Modules Connect with USB cable Upgrade Firmware Close Program Turn off m-robot Open Program Turn On Robot Connect with 2.4G

Play a Tone Example 2

Remote Control Select the xy-grid backdrop

Remote Control Delete the image on costume 1 of the Panda

Remote Control

Functions A function is a group of statements that together perform a task. Functions are a utilized to make programs: Easier to understand Easier to troubleshoot As it can be observed in next slide, the main program can be written as macro instructions. These macro instructions will be executed one by one, as described in the definitions. It may be convenient to program a robot using functions, one per robot task.

Functions This example is for the mblock and the onboard LEDs

Functions

Functions This example is for an Arduino board with an LED connected to pin 9.

Functions Observe how the ledon and LedOff blocks are represented in Arduino language.

void ledon() { digitalwrite(9,1); _delay(1); } void LedOff() { digitalwrite(9,0); _delay(1); } void setup(){ pinmode(9,output); } Code typed directly on Arduino Ide millis(): Returns the number of milliseconds since the Arduino board began running the current program. This number will overflow (go back to zero), after approximately 50 days. Other versions of the _loop() function void loop(){ ledon(); LedOff(); _loop(); } void _delay(float seconds){ long endtime = millis() + seconds * 1000; while(millis() < endtime)_loop(); } void _loop(){ } void _delay(float seconds){ long endtime = millis() + seconds * 1000; while(millis() < endtime) _loop(); void _delay(float seconds){ long endtime = millis() + seconds * 1000; while(millis() < endtime){ _loop(); }

void ledon() { digitalwrite(9,1); delay(1000); } void LedOff() { digitalwrite(9,0); delay(1000); } Simplified code on Arduino Ide void setup(){ pinmode(9,output); } void loop(){ ledon(); LedOff(); }

int frequency; void ledon() { digitalwrite(9,1); frequency = 1000; _delay(1); } void LedOff() { digitalwrite(9,0); frequency = 500; _delay(1); } void setup(){ pinmode(9,output); } void loop(){ ledon(); LedOff(); _loop(); } Advantages of the _loop() function You can execute instructions while waiting void _delay(float seconds){ long endtime = millis() + seconds * 1000; while(millis() < endtime)_loop(); } void _loop(){ tone(8, frequency); delay(100); notone(8); delay(100); }

/* * Hello World! * This is the Hello World! for Arduino. * It shows how to send data to the computer */ void setup() // run once, when the sketch starts { Serial.begin(9600); // set up Serial library at 9600 bps } Serial.println("Is anybody out there?"); // prints phrase with ending line break void loop() { } // run over and over again // do nothing! // After sending program to the Arduino, press Reset button on the board and watch Serial monitor

/* Function Example */ float quotient; void setup(){ Serial.begin(9600); quotient = divide1(7, 2); Serial.print("divide1 "); Serial.println (quotient); Serial.print("divide2 "); Serial.println (divide2(7, 2)); } void loop(){ } /* This function will return 3.00 even though it has a float type. This is because calculation is based on integers (integer math) */ float divide1(int dividend, int divisor){ float result; result = dividend/divisor; return result; } /* This function will return 3.50 the cast (type)with argument float forces float math */ float divide2(int dividend, int divisor){ float result; result = (float)dividend/divisor; return result; }

Testing The Ultrasonic sensor This program will allow to send distance measured by the ultrasonic sensor to a computer. A USB cable must be used to connect the robot to de computer. Port must be selected in mblock and in Arduino IDE.

Click Here

Distance readings will be sent to computer Select right speed

Bluetooth Communication Bluetooth communication is easy with the mbot We will illustrate with a program that sends and receives text. Connect the Bluetooth module to the mbot

Bluetooth Communication We will explain Bluetooth communication for the Android App Serial Bluetooth Terminal Install the App in your phone

Bluetooth Communication Navigate to Devices Select Bluetooth LE Click Scan Press and hold Mackeblock for further configuration

Bluetooth Communication Select Custom Press and hold each of the three bottom fields and select to the image

Bluetooth Communication Navigate to Settings Press and hold Send and select LF

Bluetooth Communication Navigate to Terminal Click on Connect You are ready to start sending your commands

Select The communication extension

Click On the Robots section The same instructions used for serial communication with the computer are used to communicate with Bluetooth

Bluetooth Communication Load the program on the left into the mbot This program will write hello and the value of counter in your cell phone The onboard LEDs will change color to red, green, or blue, depending on if you send r, g, or b from your telephone

Bluetooth Communication On the Arduino side make sure that Serial.begin() has the argument 115200.

Gripper Connections

Gripper Connections Use to male-female jumper cables to connect the gripper to the RJ25 adapter Connect the RJ25 to one port. Use the mini fan block to control