SlideShare a Scribd company logo
m-Block
By Wilmer Arellano
Wilmer Arellano © 2016
• 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.
Wilmer Arellano © 2016
• 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.
Wilmer Arellano © 2016
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
Wilmer Arellano © 2016
mBot
• Treat gently robot is
fragile, specially
additional modules
(line follower,
ultrasound, 2.4G,
Bluetooth, etc.) and
wheels
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
What is mCore?
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
Tutorials
• Resources page
• Scratch Tutorial
• m-Block Tutorial
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
Programming Structure
Wilmer Arellano © 2016
Programming Structure
Wilmer Arellano © 2016
Play a Tone Example 1
Wilmer Arellano © 2016
Loading Programs to the Robot
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
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
Wilmer Arellano © 2016
Play a Tone Example 2
Wilmer Arellano © 2016
Remote Control
• Select the xy-grid backdrop
Wilmer Arellano © 2016
Remote Control
• Delete the image on costume 1 of the Panda
Wilmer Arellano © 2016
Remote Control
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
Functions
• This example is for the mBlock and the
onboard LEDs
Wilmer Arellano © 2016
Functions
Wilmer Arellano © 2016
Functions
• This example is for an Arduino board with an
LED connected to pin 9.
Wilmer Arellano © 2016
Functions
Wilmer Arellano © 2016
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);
}
void loop(){
ledOn();
LedOff();
_loop();
}
void _delay(float seconds){
long endTime = millis() + seconds * 1000;
while(millis() < endTime)_loop();
}
void _loop(){
}
Code typed directly on Arduino Ide
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();
}
Other versions of the _loop() function
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.
Wilmer Arellano © 2016
void ledOn()
{
digitalWrite(9,1);
delay(1000);
}
void LedOff()
{
digitalWrite(9,0);
delay(1000);
}
void setup(){
pinMode(9,OUTPUT);
}
void loop(){
ledOn();
LedOff();
}
Simplified code on Arduino Ide
Wilmer Arellano © 2016
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();
}
void _delay(float seconds){
long endTime = millis() + seconds * 1000;
while(millis() < endTime)_loop();
}
void _loop(){
tone(8, frequency);
delay(100);
noTone(8);
delay(100);
}
Advantages of the _loop() function
You can execute instructions
while waiting
Wilmer Arellano © 2016
Wilmer Arellano © 2016
/*
* “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
Wilmer Arellano © 2016
/*
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;
}
Wilmer Arellano © 2016
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.
Wilmer Arellano © 2016
Wilmer Arellano © 2016
Wilmer Arellano © 2016
Click Here
Wilmer Arellano © 2016
Distance readings will be sent to computer
Select right speed
Wilmer Arellano © 2016
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
Wilmer Arellano © 2016
Bluetooth Communication
• We will explain Bluetooth
communication for the
Android App
– Serial Bluetooth Terminal
• Install the App in your
phone
Wilmer Arellano © 2016
Bluetooth Communication
• Navigate to Devices
• Select Bluetooth LE
• Click Scan
• Press and hold
Mackeblock for further
configuration
Wilmer Arellano © 2016
Bluetooth Communication
• Select Custom
• Press and hold each of
the three bottom fields
and select to the image
Wilmer Arellano © 2016
Bluetooth Communication
• Navigate to Settings
• Press and hold Send
and select “LF”
Wilmer Arellano © 2016
Bluetooth Communication
• Navigate to Terminal
• Click on Connect
• You are ready to start
sending your
commands
Wilmer Arellano © 2016
• Select The
communication
extension
Wilmer Arellano © 2016
• Click On the Robots
section
• The same instructions
used for serial
communication with
the computer are used
to communicate with
Bluetooth
Wilmer Arellano © 2016
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
Wilmer Arellano © 2016
Bluetooth Communication
• On the Arduino side
make sure that
Serial.begin() has the
argument 115200.
Wilmer Arellano © 2016
Gripper Connections
Wilmer Arellano © 2016
Gripper Connections
Wilmer Arellano © 2016
• 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

More Related Content

What's hot

Adobe illustrator basics
Adobe illustrator basicsAdobe illustrator basics
Adobe illustrator basics
Val Pirch Montgomery
 
Introduction to Scratch Programming
Introduction to Scratch ProgrammingIntroduction to Scratch Programming
Introduction to Scratch Programming
StorytimeSteph
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with Scratch
Nicole Baratta
 
Power Point Basics
Power Point BasicsPower Point Basics
Power Point Basics
Barbara McQueen
 
Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – Basics
David Oromaner
 
Introducing Adobe Animate CC
Introducing Adobe Animate CCIntroducing Adobe Animate CC
Introducing Adobe Animate CC
Joseph Labrecque
 
Adobe illustrator getting started
Adobe illustrator getting startedAdobe illustrator getting started
Adobe illustrator getting started
Danielle Oser, APR
 
Scratch Animation
Scratch AnimationScratch Animation
Scratch Animation
Anjan Mahanta
 
Presentation on Adobe Photoshop
Presentation on Adobe PhotoshopPresentation on Adobe Photoshop
Presentation on Adobe Photoshop
Mohak Jain
 
Introduction to adobe Photoshop
Introduction to adobe PhotoshopIntroduction to adobe Photoshop
Introduction to adobe Photoshop
ChristopherEsteban2
 
PPT on Photoshop
PPT on PhotoshopPPT on Photoshop
PPT on Photoshop
Paddy Lock
 
PowerPoint Lesson 1: PowerPoint Basics
PowerPoint Lesson 1: PowerPoint BasicsPowerPoint Lesson 1: PowerPoint Basics
PowerPoint Lesson 1: PowerPoint Basics
Novus Business and IT Training Program
 
Photoshop layers
Photoshop layersPhotoshop layers
Photoshop layers
Marche Ygar
 
DAY 2 - Starting in Photoshop (Images and Layers)
DAY 2 - Starting in Photoshop (Images and Layers)DAY 2 - Starting in Photoshop (Images and Layers)
DAY 2 - Starting in Photoshop (Images and Layers)
Sef Cambaliza
 
Scratch Basics
Scratch BasicsScratch Basics
Scratch Basics
St. Petersburg College
 
Scratch programming
Scratch programmingScratch programming
Scratch programming
YvonieDoria
 
Premiere Pro Step by Step Guide
Premiere Pro Step by Step GuidePremiere Pro Step by Step Guide
Premiere Pro Step by Step Guide
Charlotte Jean
 
Computer Parts Lesson 1
Computer Parts Lesson 1Computer Parts Lesson 1
Computer Parts Lesson 1
yesserNoueiry
 
The Art of Photo Manipulation Technique
The Art of Photo Manipulation TechniqueThe Art of Photo Manipulation Technique
The Art of Photo Manipulation Technique
Image Clipping Path Services
 
Introduction to ms power point Grade 9
Introduction to ms power point Grade 9Introduction to ms power point Grade 9
Introduction to ms power point Grade 9
ninoallandanganancarpio
 

What's hot (20)

Adobe illustrator basics
Adobe illustrator basicsAdobe illustrator basics
Adobe illustrator basics
 
Introduction to Scratch Programming
Introduction to Scratch ProgrammingIntroduction to Scratch Programming
Introduction to Scratch Programming
 
Coding Basics with Scratch
Coding Basics with ScratchCoding Basics with Scratch
Coding Basics with Scratch
 
Power Point Basics
Power Point BasicsPower Point Basics
Power Point Basics
 
Scratch Lesson 1 – Basics
Scratch Lesson 1 – BasicsScratch Lesson 1 – Basics
Scratch Lesson 1 – Basics
 
Introducing Adobe Animate CC
Introducing Adobe Animate CCIntroducing Adobe Animate CC
Introducing Adobe Animate CC
 
Adobe illustrator getting started
Adobe illustrator getting startedAdobe illustrator getting started
Adobe illustrator getting started
 
Scratch Animation
Scratch AnimationScratch Animation
Scratch Animation
 
Presentation on Adobe Photoshop
Presentation on Adobe PhotoshopPresentation on Adobe Photoshop
Presentation on Adobe Photoshop
 
Introduction to adobe Photoshop
Introduction to adobe PhotoshopIntroduction to adobe Photoshop
Introduction to adobe Photoshop
 
PPT on Photoshop
PPT on PhotoshopPPT on Photoshop
PPT on Photoshop
 
PowerPoint Lesson 1: PowerPoint Basics
PowerPoint Lesson 1: PowerPoint BasicsPowerPoint Lesson 1: PowerPoint Basics
PowerPoint Lesson 1: PowerPoint Basics
 
Photoshop layers
Photoshop layersPhotoshop layers
Photoshop layers
 
DAY 2 - Starting in Photoshop (Images and Layers)
DAY 2 - Starting in Photoshop (Images and Layers)DAY 2 - Starting in Photoshop (Images and Layers)
DAY 2 - Starting in Photoshop (Images and Layers)
 
Scratch Basics
Scratch BasicsScratch Basics
Scratch Basics
 
Scratch programming
Scratch programmingScratch programming
Scratch programming
 
Premiere Pro Step by Step Guide
Premiere Pro Step by Step GuidePremiere Pro Step by Step Guide
Premiere Pro Step by Step Guide
 
Computer Parts Lesson 1
Computer Parts Lesson 1Computer Parts Lesson 1
Computer Parts Lesson 1
 
The Art of Photo Manipulation Technique
The Art of Photo Manipulation TechniqueThe Art of Photo Manipulation Technique
The Art of Photo Manipulation Technique
 
Introduction to ms power point Grade 9
Introduction to ms power point Grade 9Introduction to ms power point Grade 9
Introduction to ms power point Grade 9
 

Similar to mBot

How To make your own Robot And control it using labview
How To make your own Robot And control it using labviewHow To make your own Robot And control it using labview
How To make your own Robot And control it using labview
Aymen Lachkhem
 
Introduction to Flowol
Introduction to FlowolIntroduction to Flowol
Introduction to Flowol
mrpeddle
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
Dr. Pankaj Zope
 
First fare 2013 basic-labview
First fare 2013   basic-labviewFirst fare 2013   basic-labview
First fare 2013 basic-labview
Oregon FIRST Robotics
 
E- Notice Board Presentation
E- Notice Board PresentationE- Notice Board Presentation
E- Notice Board Presentation
ayushi jain
 
Advanced view of atmega microcontroller projects list at mega32 avr
Advanced view of atmega microcontroller projects list   at mega32 avrAdvanced view of atmega microcontroller projects list   at mega32 avr
Advanced view of atmega microcontroller projects list at mega32 avr
WiseNaeem
 
Operating systems and computing networks
Operating systems and computing networksOperating systems and computing networks
Operating systems and computing networks
Rociocmf
 
Bluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything IndiaBluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything India
Dcube Tech Ventures
 
Lecture2 interactive-start
Lecture2 interactive-startLecture2 interactive-start
Lecture2 interactive-start
Dennis Seidel
 
arduino
arduinoarduino
arduino
murbz
 
IoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkit
IoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkitIoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkit
IoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkit
Open Mobile Alliance
 
Using the cisco console in linux
Using the cisco console in linux Using the cisco console in linux
Using the cisco console in linux
IT Tech
 
Android ch2..pptx
Android ch2..pptxAndroid ch2..pptx
Android ch2..pptx
mohamedMoktarMohamed
 
Sec285 final presentation_joshua_brown
Sec285 final presentation_joshua_brownSec285 final presentation_joshua_brown
Sec285 final presentation_joshua_brown
JoshuaBrown233
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
Skillspire LLC
 
An introduction to java programming language forbeginners(java programming tu...
An introduction to java programming language forbeginners(java programming tu...An introduction to java programming language forbeginners(java programming tu...
An introduction to java programming language forbeginners(java programming tu...
Daroko blog(www.professionalbloggertricks.com)
 
VPCs, Metrics Framework, Back pressure : MuleSoft Virtual Muleys Meetups
VPCs, Metrics Framework, Back pressure  : MuleSoft Virtual Muleys MeetupsVPCs, Metrics Framework, Back pressure  : MuleSoft Virtual Muleys Meetups
VPCs, Metrics Framework, Back pressure : MuleSoft Virtual Muleys Meetups
Angel Alberici
 
Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...
chandan kumar
 
Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...
birsa institute of technical education
 
Smart homes using android
Smart homes using androidSmart homes using android
Smart homes using android
Droidcon Berlin
 

Similar to mBot (20)

How To make your own Robot And control it using labview
How To make your own Robot And control it using labviewHow To make your own Robot And control it using labview
How To make your own Robot And control it using labview
 
Introduction to Flowol
Introduction to FlowolIntroduction to Flowol
Introduction to Flowol
 
Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming Unit III ARM Interface and ARM Programming
Unit III ARM Interface and ARM Programming
 
First fare 2013 basic-labview
First fare 2013   basic-labviewFirst fare 2013   basic-labview
First fare 2013 basic-labview
 
E- Notice Board Presentation
E- Notice Board PresentationE- Notice Board Presentation
E- Notice Board Presentation
 
Advanced view of atmega microcontroller projects list at mega32 avr
Advanced view of atmega microcontroller projects list   at mega32 avrAdvanced view of atmega microcontroller projects list   at mega32 avr
Advanced view of atmega microcontroller projects list at mega32 avr
 
Operating systems and computing networks
Operating systems and computing networksOperating systems and computing networks
Operating systems and computing networks
 
Bluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything IndiaBluetooth quick start_guide / Controlanything India
Bluetooth quick start_guide / Controlanything India
 
Lecture2 interactive-start
Lecture2 interactive-startLecture2 interactive-start
Lecture2 interactive-start
 
arduino
arduinoarduino
arduino
 
IoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkit
IoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkitIoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkit
IoT Seminar (Jan. 2016) - (7) joaquin prado - oma developer toolkit
 
Using the cisco console in linux
Using the cisco console in linux Using the cisco console in linux
Using the cisco console in linux
 
Android ch2..pptx
Android ch2..pptxAndroid ch2..pptx
Android ch2..pptx
 
Sec285 final presentation_joshua_brown
Sec285 final presentation_joshua_brownSec285 final presentation_joshua_brown
Sec285 final presentation_joshua_brown
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
An introduction to java programming language forbeginners(java programming tu...
An introduction to java programming language forbeginners(java programming tu...An introduction to java programming language forbeginners(java programming tu...
An introduction to java programming language forbeginners(java programming tu...
 
VPCs, Metrics Framework, Back pressure : MuleSoft Virtual Muleys Meetups
VPCs, Metrics Framework, Back pressure  : MuleSoft Virtual Muleys MeetupsVPCs, Metrics Framework, Back pressure  : MuleSoft Virtual Muleys Meetups
VPCs, Metrics Framework, Back pressure : MuleSoft Virtual Muleys Meetups
 
Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...
 
Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...Speed and direction control of dc motor using android mobile application chan...
Speed and direction control of dc motor using android mobile application chan...
 
Smart homes using android
Smart homes using androidSmart homes using android
Smart homes using android
 

Recently uploaded

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
Madan Karki
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
JamalHussainArman
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
jpsjournal1
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
Madan Karki
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
amsjournal
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
Victor Morales
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
Las Vegas Warehouse
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
sachin chaurasia
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 

Recently uploaded (20)

spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Manufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptxManufacturing Process of molasses based distillery ppt.pptx
Manufacturing Process of molasses based distillery ppt.pptx
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptxML Based Model for NIDS MSc Updated Presentation.v2.pptx
ML Based Model for NIDS MSc Updated Presentation.v2.pptx
 
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECTCHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
CHINA’S GEO-ECONOMIC OUTREACH IN CENTRAL ASIAN COUNTRIES AND FUTURE PROSPECT
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
john krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptxjohn krisinger-the science and history of the alcoholic beverage.pptx
john krisinger-the science and history of the alcoholic beverage.pptx
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
UNLOCKING HEALTHCARE 4.0: NAVIGATING CRITICAL SUCCESS FACTORS FOR EFFECTIVE I...
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressionsKuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
KuberTENes Birthday Bash Guadalajara - K8sGPT first impressions
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have oneISPM 15 Heat Treated Wood Stamps and why your shipping must have one
ISPM 15 Heat Treated Wood Stamps and why your shipping must have one
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.The Python for beginners. This is an advance computer language.
The Python for beginners. This is an advance computer language.
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 

mBot

  • 2. • 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. Wilmer Arellano © 2016
  • 3. • 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. Wilmer Arellano © 2016
  • 4. 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 Wilmer Arellano © 2016
  • 5. mBot • Treat gently robot is fragile, specially additional modules (line follower, ultrasound, 2.4G, Bluetooth, etc.) and wheels Wilmer Arellano © 2016
  • 6. 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. Wilmer Arellano © 2016
  • 7. What is mCore? Wilmer Arellano © 2016
  • 8. 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. Wilmer Arellano © 2016
  • 9. Tutorials • Resources page • Scratch Tutorial • m-Block Tutorial Wilmer Arellano © 2016
  • 10. 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. Wilmer Arellano © 2016
  • 13. Play a Tone Example 1 Wilmer Arellano © 2016
  • 14. Loading Programs to the Robot Wilmer Arellano © 2016
  • 15. 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. Wilmer Arellano © 2016
  • 16. 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. Wilmer Arellano © 2016
  • 17. 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 Wilmer Arellano © 2016
  • 18. Play a Tone Example 2 Wilmer Arellano © 2016
  • 19. Remote Control • Select the xy-grid backdrop Wilmer Arellano © 2016
  • 20. Remote Control • Delete the image on costume 1 of the Panda Wilmer Arellano © 2016
  • 22. 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. Wilmer Arellano © 2016
  • 23. Functions • This example is for the mBlock and the onboard LEDs Wilmer Arellano © 2016
  • 25. Functions • This example is for an Arduino board with an LED connected to pin 9. Wilmer Arellano © 2016
  • 26. Functions Wilmer Arellano © 2016 Observe how the ledOn and LedOff blocks are represented in Arduino language.
  • 27. void ledOn() { digitalWrite(9,1); _delay(1); } void LedOff() { digitalWrite(9,0); _delay(1); } void setup(){ pinMode(9,OUTPUT); } void loop(){ ledOn(); LedOff(); _loop(); } void _delay(float seconds){ long endTime = millis() + seconds * 1000; while(millis() < endTime)_loop(); } void _loop(){ } Code typed directly on Arduino Ide 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(); } Other versions of the _loop() function 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. Wilmer Arellano © 2016
  • 28. void ledOn() { digitalWrite(9,1); delay(1000); } void LedOff() { digitalWrite(9,0); delay(1000); } void setup(){ pinMode(9,OUTPUT); } void loop(){ ledOn(); LedOff(); } Simplified code on Arduino Ide Wilmer Arellano © 2016
  • 29. 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(); } void _delay(float seconds){ long endTime = millis() + seconds * 1000; while(millis() < endTime)_loop(); } void _loop(){ tone(8, frequency); delay(100); noTone(8); delay(100); } Advantages of the _loop() function You can execute instructions while waiting Wilmer Arellano © 2016
  • 31. /* * “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 Wilmer Arellano © 2016
  • 32. /* 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; } Wilmer Arellano © 2016
  • 33. 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. Wilmer Arellano © 2016
  • 37. Distance readings will be sent to computer Select right speed Wilmer Arellano © 2016
  • 38. 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 Wilmer Arellano © 2016
  • 39. Bluetooth Communication • We will explain Bluetooth communication for the Android App – Serial Bluetooth Terminal • Install the App in your phone Wilmer Arellano © 2016
  • 40. Bluetooth Communication • Navigate to Devices • Select Bluetooth LE • Click Scan • Press and hold Mackeblock for further configuration Wilmer Arellano © 2016
  • 41. Bluetooth Communication • Select Custom • Press and hold each of the three bottom fields and select to the image Wilmer Arellano © 2016
  • 42. Bluetooth Communication • Navigate to Settings • Press and hold Send and select “LF” Wilmer Arellano © 2016
  • 43. Bluetooth Communication • Navigate to Terminal • Click on Connect • You are ready to start sending your commands Wilmer Arellano © 2016
  • 45. • Click On the Robots section • The same instructions used for serial communication with the computer are used to communicate with Bluetooth Wilmer Arellano © 2016
  • 46. 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 Wilmer Arellano © 2016
  • 47. Bluetooth Communication • On the Arduino side make sure that Serial.begin() has the argument 115200. Wilmer Arellano © 2016
  • 49. Gripper Connections Wilmer Arellano © 2016 • 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