SlideShare uma empresa Scribd logo
1 de 39
What is a Robot?
RobotsRobots
• A machine that is able to interact
with and respond to its
environment in an autonomous
fashion.
• A robot is characterized by
three central capabilities: the
ability to Sense, the ability to
Plan, and the ability to Act.
Sense, Plan, Act.
NXTNXT BrickBrick
• The electronic component that
controls the operation of the
robot by following instructions
contained in a stored program.
Based on these instructions and
the data received from any
connected sensors, the NXT can
direct the actions of the robot to
perform a large range of tasks.
SensorsSensors
• A device that detects some important
physical quality or quantity about the
surrounding environment, and conveys the
information to the robot in electronic form.
A Sound Sensor, for example, will detect,
vibrations in the air, and
send an electrical signal
to the NXT indicating
how strong those vibrations
were.
TheThe KitKit
KitKit ManagementManagement
• Store Kit in same location
• At beginning of class get kit ready
• With 3 min left start cleaning
• Do not loose or break pieces
• Follow instructions
• Keep pieces in correct bin
FirstFirst RobotRobot
• Build the basic taskbot with no
sensors attached located on
Page 8 of the Mindstorms
Education Book located in your
kit.
ProgrammingProgramming
• Once your robot has been constructed
the next step is to get it to do
something. For that we are going to
have to learn about Programming.
Programming is the act of creating
software or some other set of
instructions for a Computer/Robot.
10100100 10010100 111100101
101010110 1101010101
Block ProgrammingBlock Programming
• A block is the basic unit of programming
in the NXT programming software.
Generally, one block represents one
command given to the robot, although
some blocks (such as the Loop block)
are used instead to organize and control
the execution of other blocks. Blocks
perform their operations in order along
the Sequence Beam
CodingCoding
• Code: General term for any command or group
of commands in a program. In the NXT
Programming Software, this is one or more
blocks.
• Compiler: The compiler is a part of the NXT
Programming Software that takes the blocks in a
program and converts them into machine
language that the NXT brick can understand and
run. The compiled code is not exactly the same
as the code written in blocks on your computer;
this is why you cannot load the program back
onto the computer once it is compiled and
downloaded to the NXT.
Interactive Servo Motor
• The primary source of physical motion in the
Mindstorms NXT system. The Interactive Servo
Motors include both an electric motor (which
allows them to spin the orange barrel portion of
the motor on command) and a built-in rotation
sensor. The rotation sensor allows the NXT to
monitor the amount the motor has turned, and
control the motors accordingly.
BlocksBlocks
• Motor/Move Block: Blocks designed to
control motors on the robot. The Motor and
Move blocks can both be used to control the
movement of a robot, and have both
advantages and disadvantages in doing so.
• Loop Block: In the NXT programming
software, a programming block that repeats
sequences of code. Its default behavior is to
repeat the blocks it contains forever, but it
can be configured to repeat them for given
numbers of times, or under certain
conditions.
Programming Activities
• Move Forward:
• Move_motor_multi.rbt
• Move_motor_same_line.rbt
• Move_motorblock.rbt
• Square Move:
• Squaremove_no_loop.rbt
• Squaremove_loop.rbt
• Circle
• Circle_1_moveblock.rbt
• Figure 8
• Figure 8_loop.rbt
Sound & Display Blocks
Sound Block
Display Block
Use this block to display an image, write some text, or draw a
shape on the NXT’s display screen.
You can use this block to play a sound file or a single tone. To
compose a melody of tones, arrange several sound blocks in a
row with each set to play different tones.
The Wait BlockThe Wait Block
• This block lets your robot sense its
environment for a certain condition before
it continues. Use the slider or type in a
value to set a trigger point so that the
program continues when sensor values
are below or above it.
Programming Activity
• Sounds.rbt – Use the sound blocks to
make your robot make three different
sounds. They can be words or notes.
• Display.rbt – Use the display block and the
wait block to make something appear on
your screen for 3 seconds then have
another something else appear for 3
seconds. It can be either an image or text.
Lesson 3Lesson 3
Today’s Programs
• Detect Sound
• Sound Direction
• Sound Power
SensorsSensors
• A device that detects some important
physical quality or quantity about the
surrounding environment, and conveys the
information to the robot in electronic form.
A Sound Sensor, for example, will detect,
vibrations in the air, and
send an electrical signal
to the NXT indicating
how strong those vibrations
were.
ImportantImportant ConceptsConcepts
• Input: Something which is sent to the
NXT which is used in its program. An
input is typically a sensor value sent by
a sensor.
• Output: Something which NXT sends.
An output is typically power sent to a
motor.
The Wait BlockThe Wait Block
• This block lets your robot sense its
environment for a certain condition before
it continues. Use the slider or type in a
value to set a trigger point so that the
program continues when sensor values
are below or above it.
BlocksBlocks
• Switch Block: In the NXT programming
software, a Switch block chooses between
two sequences of code. For example, when
configured with a Touch Sensor, the Switch
block might run one series of blocks when
the sensor is pressed and another when it is
not pressed.
• Sound Sensor: An NXT sensor that detects
sound waves and reports the amount of
sound back to the NXT.
Programming Activity
• Detect Sound.rbt – a move block, a wait block and a
stop block, create a program that will cause the robot to
stop driving when you clap.
• Sound Direction.rbt – Using Loop, Switch, and move
blocks, create a program that will cause your robot to
drive forwards when it is quiet and backwards when it is
loud.
• Sound Power.rbt – Using a loop block, a move block
and a sound sensor block, create a program where your
robot will go faster or slower depending on the volume
around it. Remember to connect the data hub from the
Sound Sensor Block to the power hub on the move
block.
Data StuffData Stuff
• Data: Factual information, like the weight of a robot or the value
of a sensor.
• Data Flow: The process of moving data inside of a program, so
that information coming out of one block as data can be input
into another block as a control.
• Data Hub: A feature of most programming blocks which can be
accessed by clicking on the lower left edge of the block. Note
that sometimes two clicks are required to extend the Data Hub
completely. Data Hubs allow programming blocks to input
(receive) or output (send) data through Data Wires.
• Data Plug:. Each Data Hub consists of a number of Data Plugs,
which carry a specific type of data, including number data, logic
data and text data.
• Data Wire: Wires that connect output plugs from one block’s
data hub to input plugs on another block’s. To create a data wire,
click on a data plug, drag the wire that appears to another Plug,
and click again to wire the two Plugs together.
Data Hub Demonstration
• The Random Block and a Move block
Ultrasonic Sensor
• Ultrasonic sensors generate high
frequency sound waves and evaluate the
echo which is received back by the
sensor. Sensors calculate the time interval
between sending the signal and receiving
the echo to determine the distance to an
object.
Programming Activity
• Distance Stop.rbt – Using a loop block,
switch block and 2 move blocks make
your robot drive around until something is
closer that 25cm. When it comes within
25cm of another object it should stop.
Programming Activity
• Distance Turn – Using a loop block, switch
block and 2 move blocks make a program
where your robot will drive around and
avoid obstacles.
New Blocks
• Number to Text Block -This block will take
a number (like a reading from a sensor)
and turn it into text that can be displayed
on the NXT’s screen. The input number
can be typed in or supplied dynamically by
a data wire.
Data StuffData Stuff
• Data: Factual information, like the weight of a robot or the value
of a sensor.
• Data Flow: The process of moving data inside of a program, so
that information coming out of one block as data can be input
into another block as a control.
• Data Hub: A feature of most programming blocks which can be
accessed by clicking on the lower left edge of the block. Note
that sometimes two clicks are required to extend the Data Hub
completely. Data Hubs allow programming blocks to input
(receive) or output (send) data through Data Wires.
• Data Plug:. Each Data Hub consists of a number of Data Plugs,
which carry a specific type of data, including number data, logic
data and text data.
• Data Wire: Wires that connect output plugs from one block’s
data hub to input plugs on another block’s. To create a data wire,
click on a data plug, drag the wire that appears to another Plug,
and click again to wire the two Plugs together.
Programming Activity
• Display Distance.rbt – Make a program
where your display screen will show the
distance from your ultrasonic sensor to the
objects in front of it. Use a Sensor Block,
Number to Text block and a Display Block.
Light Sensor
• The light sensor includes a light emitting
diode (LED) light source that can be tuned
on and off from software. This allows to
measure either the reflected LED light
shining back from an object or the ambient
light falling on the sensor.
ThresholdThreshold:
• A “cutoff” or dividing line between two regions.
One common use for thresholds is to divide the
hundreds of possible sensor readings from a
sensor (a Light Sensor can give a value
anywhere from 0-100, for example) into two
manageable categories.
Threshold = Value A + Value B
2
Programming Activity
• Stop at line.rbt – using 2 move blocks,
and a wait block– make a program that will
cause your robot to stop when it drives
over the black line.
Programming Activity
• Follow Line.rbt – Using a loop, switch
and 4 move blocks create a program that
will cause your robot to follow the black
line.
Programming Activity
• Basic sumo.rbt – create a program that
will cause your robot to drive around
inside the black sumo wrestling ring, with
out falling out. – Loop, move, wait blocks.
Multitasking
Programming Activity
• Multitask.rbt – Using your basic sumo
program, make it so if it senses an
opponent closer that 30cm it will charge
forward really fast.

Mais conteúdo relacionado

Mais procurados

Robots presentation
Robots presentationRobots presentation
Robots presentation
aroobkazim
 
Humanoid Robots || PPT || for electronic and electrical engineering
Humanoid Robots || PPT || for electronic and electrical engineeringHumanoid Robots || PPT || for electronic and electrical engineering
Humanoid Robots || PPT || for electronic and electrical engineering
Aakash Raj
 
Introduction To Robotics
Introduction To RoboticsIntroduction To Robotics
Introduction To Robotics
parthmullick
 

Mais procurados (20)

Robots presentation
Robots presentationRobots presentation
Robots presentation
 
Robotics
RoboticsRobotics
Robotics
 
Industrial applications of robots
Industrial applications of robotsIndustrial applications of robots
Industrial applications of robots
 
Robotics
Robotics Robotics
Robotics
 
Humanoid Robots || PPT || for electronic and electrical engineering
Humanoid Robots || PPT || for electronic and electrical engineeringHumanoid Robots || PPT || for electronic and electrical engineering
Humanoid Robots || PPT || for electronic and electrical engineering
 
Robotics presentation
Robotics presentationRobotics presentation
Robotics presentation
 
robotics ppt
robotics ppt robotics ppt
robotics ppt
 
robotics
roboticsrobotics
robotics
 
The humanoid robots
The humanoid robotsThe humanoid robots
The humanoid robots
 
Robotic technology
Robotic technologyRobotic technology
Robotic technology
 
Robotic introduction
Robotic introductionRobotic introduction
Robotic introduction
 
Robotics
Robotics Robotics
Robotics
 
ROBOTICS
ROBOTICS ROBOTICS
ROBOTICS
 
Humanoid robots
Humanoid robotsHumanoid robots
Humanoid robots
 
Unit 1 - Introduction to robotics
Unit 1 - Introduction to roboticsUnit 1 - Introduction to robotics
Unit 1 - Introduction to robotics
 
Robotics
RoboticsRobotics
Robotics
 
Pick and place robot ppt
Pick and place robot pptPick and place robot ppt
Pick and place robot ppt
 
Robots.pptx 1
Robots.pptx 1Robots.pptx 1
Robots.pptx 1
 
ASIMO HUMANOID ROBOT PRESENTATION
ASIMO HUMANOID ROBOT PRESENTATIONASIMO HUMANOID ROBOT PRESENTATION
ASIMO HUMANOID ROBOT PRESENTATION
 
Introduction To Robotics
Introduction To RoboticsIntroduction To Robotics
Introduction To Robotics
 

Semelhante a Lego mindstorms intro

<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...
<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...
<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...
a17b19
 
Introduction to the NXT
Introduction to the NXTIntroduction to the NXT
Introduction to the NXT
asrctw
 
Basic Programming Blocks
Basic Programming BlocksBasic Programming Blocks
Basic Programming Blocks
asrctw
 
Introducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollersIntroducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollers
Sandeep Kamath
 
Introduction to robotics part 1 (Lego NXT
Introduction to robotics part 1 (Lego NXTIntroduction to robotics part 1 (Lego NXT
Introduction to robotics part 1 (Lego NXT
Wayne Hamilton
 

Semelhante a Lego mindstorms intro (20)

<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...
<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...
<iframe width="427" src="http://www.slideshare.net/slideshow/embed_code/34...
 
Introduction to the NXT
Introduction to the NXTIntroduction to the NXT
Introduction to the NXT
 
Basic Programming Blocks
Basic Programming BlocksBasic Programming Blocks
Basic Programming Blocks
 
Robotic 11-26-14
Robotic 11-26-14Robotic 11-26-14
Robotic 11-26-14
 
Embedded system and its platforms
Embedded system and its platformsEmbedded system and its platforms
Embedded system and its platforms
 
ROBOTICS - Introduction to Robotics Microcontroller
ROBOTICS -  Introduction to Robotics MicrocontrollerROBOTICS -  Introduction to Robotics Microcontroller
ROBOTICS - Introduction to Robotics Microcontroller
 
microbit Microbit programming Microbit programming
microbit Microbit programming Microbit programmingmicrobit Microbit programming Microbit programming
microbit Microbit programming Microbit programming
 
Autonomous robotics based on simple sensor inputs.
Autonomous robotics based on simplesensor inputs.Autonomous robotics based on simplesensor inputs.
Autonomous robotics based on simple sensor inputs.
 
robotics and its components
robotics and its componentsrobotics and its components
robotics and its components
 
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOTCONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
CONDITION BASED MONITORING AND CONTROL OF INDUCTION MOTOR USSING IOT
 
Sensor and Actuators using Rasberry Pi controller
Sensor and Actuators using Rasberry Pi controllerSensor and Actuators using Rasberry Pi controller
Sensor and Actuators using Rasberry Pi controller
 
Getting Started with TDS1000B / 2000B Digital Phosphor Oscilloscope Series
Getting Started with TDS1000B / 2000B  Digital Phosphor Oscilloscope SeriesGetting Started with TDS1000B / 2000B  Digital Phosphor Oscilloscope Series
Getting Started with TDS1000B / 2000B Digital Phosphor Oscilloscope Series
 
A guide to common automation terms
A guide to common automation termsA guide to common automation terms
A guide to common automation terms
 
Introducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollersIntroducttion to robotics and microcontrollers
Introducttion to robotics and microcontrollers
 
Presentation on embedded system and robotics
Presentation on embedded system and roboticsPresentation on embedded system and robotics
Presentation on embedded system and robotics
 
proj (2)
proj (2)proj (2)
proj (2)
 
Introduction to robotics part 1 (Lego NXT
Introduction to robotics part 1 (Lego NXTIntroduction to robotics part 1 (Lego NXT
Introduction to robotics part 1 (Lego NXT
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
IOT beginnners
IOT beginnnersIOT beginnners
IOT beginnners
 
TestowanieIoT2016
TestowanieIoT2016TestowanieIoT2016
TestowanieIoT2016
 

Mais de Philip Sweezey (8)

Standards of Practice for School Library Learning Commons in Canada 2014
Standards of Practice for School Library Learning Commons in Canada 2014Standards of Practice for School Library Learning Commons in Canada 2014
Standards of Practice for School Library Learning Commons in Canada 2014
 
Weather Station at St. Macs
Weather Station at St. MacsWeather Station at St. Macs
Weather Station at St. Macs
 
Storyboarding basics
Storyboarding basicsStoryboarding basics
Storyboarding basics
 
How to make a movie (The Basics)
How to make a movie (The Basics)How to make a movie (The Basics)
How to make a movie (The Basics)
 
Sumo Robotics Competition
Sumo Robotics CompetitionSumo Robotics Competition
Sumo Robotics Competition
 
Kodu game design
Kodu game designKodu game design
Kodu game design
 
Graphic design for
Graphic design forGraphic design for
Graphic design for
 
Graphic Design Intro
Graphic Design IntroGraphic Design Intro
Graphic Design Intro
 

Último

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 

Último (20)

Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Lego mindstorms intro

  • 1.
  • 2. What is a Robot?
  • 3. RobotsRobots • A machine that is able to interact with and respond to its environment in an autonomous fashion. • A robot is characterized by three central capabilities: the ability to Sense, the ability to Plan, and the ability to Act. Sense, Plan, Act.
  • 4. NXTNXT BrickBrick • The electronic component that controls the operation of the robot by following instructions contained in a stored program. Based on these instructions and the data received from any connected sensors, the NXT can direct the actions of the robot to perform a large range of tasks.
  • 5. SensorsSensors • A device that detects some important physical quality or quantity about the surrounding environment, and conveys the information to the robot in electronic form. A Sound Sensor, for example, will detect, vibrations in the air, and send an electrical signal to the NXT indicating how strong those vibrations were.
  • 7. KitKit ManagementManagement • Store Kit in same location • At beginning of class get kit ready • With 3 min left start cleaning • Do not loose or break pieces • Follow instructions • Keep pieces in correct bin
  • 8. FirstFirst RobotRobot • Build the basic taskbot with no sensors attached located on Page 8 of the Mindstorms Education Book located in your kit.
  • 9. ProgrammingProgramming • Once your robot has been constructed the next step is to get it to do something. For that we are going to have to learn about Programming. Programming is the act of creating software or some other set of instructions for a Computer/Robot. 10100100 10010100 111100101 101010110 1101010101
  • 10. Block ProgrammingBlock Programming • A block is the basic unit of programming in the NXT programming software. Generally, one block represents one command given to the robot, although some blocks (such as the Loop block) are used instead to organize and control the execution of other blocks. Blocks perform their operations in order along the Sequence Beam
  • 11. CodingCoding • Code: General term for any command or group of commands in a program. In the NXT Programming Software, this is one or more blocks. • Compiler: The compiler is a part of the NXT Programming Software that takes the blocks in a program and converts them into machine language that the NXT brick can understand and run. The compiled code is not exactly the same as the code written in blocks on your computer; this is why you cannot load the program back onto the computer once it is compiled and downloaded to the NXT.
  • 12. Interactive Servo Motor • The primary source of physical motion in the Mindstorms NXT system. The Interactive Servo Motors include both an electric motor (which allows them to spin the orange barrel portion of the motor on command) and a built-in rotation sensor. The rotation sensor allows the NXT to monitor the amount the motor has turned, and control the motors accordingly.
  • 13. BlocksBlocks • Motor/Move Block: Blocks designed to control motors on the robot. The Motor and Move blocks can both be used to control the movement of a robot, and have both advantages and disadvantages in doing so. • Loop Block: In the NXT programming software, a programming block that repeats sequences of code. Its default behavior is to repeat the blocks it contains forever, but it can be configured to repeat them for given numbers of times, or under certain conditions.
  • 14. Programming Activities • Move Forward: • Move_motor_multi.rbt • Move_motor_same_line.rbt • Move_motorblock.rbt • Square Move: • Squaremove_no_loop.rbt • Squaremove_loop.rbt • Circle • Circle_1_moveblock.rbt • Figure 8 • Figure 8_loop.rbt
  • 15. Sound & Display Blocks Sound Block Display Block Use this block to display an image, write some text, or draw a shape on the NXT’s display screen. You can use this block to play a sound file or a single tone. To compose a melody of tones, arrange several sound blocks in a row with each set to play different tones.
  • 16. The Wait BlockThe Wait Block • This block lets your robot sense its environment for a certain condition before it continues. Use the slider or type in a value to set a trigger point so that the program continues when sensor values are below or above it.
  • 17. Programming Activity • Sounds.rbt – Use the sound blocks to make your robot make three different sounds. They can be words or notes. • Display.rbt – Use the display block and the wait block to make something appear on your screen for 3 seconds then have another something else appear for 3 seconds. It can be either an image or text.
  • 19. Today’s Programs • Detect Sound • Sound Direction • Sound Power
  • 20. SensorsSensors • A device that detects some important physical quality or quantity about the surrounding environment, and conveys the information to the robot in electronic form. A Sound Sensor, for example, will detect, vibrations in the air, and send an electrical signal to the NXT indicating how strong those vibrations were.
  • 21. ImportantImportant ConceptsConcepts • Input: Something which is sent to the NXT which is used in its program. An input is typically a sensor value sent by a sensor. • Output: Something which NXT sends. An output is typically power sent to a motor.
  • 22. The Wait BlockThe Wait Block • This block lets your robot sense its environment for a certain condition before it continues. Use the slider or type in a value to set a trigger point so that the program continues when sensor values are below or above it.
  • 23. BlocksBlocks • Switch Block: In the NXT programming software, a Switch block chooses between two sequences of code. For example, when configured with a Touch Sensor, the Switch block might run one series of blocks when the sensor is pressed and another when it is not pressed. • Sound Sensor: An NXT sensor that detects sound waves and reports the amount of sound back to the NXT.
  • 24. Programming Activity • Detect Sound.rbt – a move block, a wait block and a stop block, create a program that will cause the robot to stop driving when you clap. • Sound Direction.rbt – Using Loop, Switch, and move blocks, create a program that will cause your robot to drive forwards when it is quiet and backwards when it is loud. • Sound Power.rbt – Using a loop block, a move block and a sound sensor block, create a program where your robot will go faster or slower depending on the volume around it. Remember to connect the data hub from the Sound Sensor Block to the power hub on the move block.
  • 25. Data StuffData Stuff • Data: Factual information, like the weight of a robot or the value of a sensor. • Data Flow: The process of moving data inside of a program, so that information coming out of one block as data can be input into another block as a control. • Data Hub: A feature of most programming blocks which can be accessed by clicking on the lower left edge of the block. Note that sometimes two clicks are required to extend the Data Hub completely. Data Hubs allow programming blocks to input (receive) or output (send) data through Data Wires. • Data Plug:. Each Data Hub consists of a number of Data Plugs, which carry a specific type of data, including number data, logic data and text data. • Data Wire: Wires that connect output plugs from one block’s data hub to input plugs on another block’s. To create a data wire, click on a data plug, drag the wire that appears to another Plug, and click again to wire the two Plugs together.
  • 26. Data Hub Demonstration • The Random Block and a Move block
  • 27. Ultrasonic Sensor • Ultrasonic sensors generate high frequency sound waves and evaluate the echo which is received back by the sensor. Sensors calculate the time interval between sending the signal and receiving the echo to determine the distance to an object.
  • 28. Programming Activity • Distance Stop.rbt – Using a loop block, switch block and 2 move blocks make your robot drive around until something is closer that 25cm. When it comes within 25cm of another object it should stop.
  • 29. Programming Activity • Distance Turn – Using a loop block, switch block and 2 move blocks make a program where your robot will drive around and avoid obstacles.
  • 30. New Blocks • Number to Text Block -This block will take a number (like a reading from a sensor) and turn it into text that can be displayed on the NXT’s screen. The input number can be typed in or supplied dynamically by a data wire.
  • 31. Data StuffData Stuff • Data: Factual information, like the weight of a robot or the value of a sensor. • Data Flow: The process of moving data inside of a program, so that information coming out of one block as data can be input into another block as a control. • Data Hub: A feature of most programming blocks which can be accessed by clicking on the lower left edge of the block. Note that sometimes two clicks are required to extend the Data Hub completely. Data Hubs allow programming blocks to input (receive) or output (send) data through Data Wires. • Data Plug:. Each Data Hub consists of a number of Data Plugs, which carry a specific type of data, including number data, logic data and text data. • Data Wire: Wires that connect output plugs from one block’s data hub to input plugs on another block’s. To create a data wire, click on a data plug, drag the wire that appears to another Plug, and click again to wire the two Plugs together.
  • 32. Programming Activity • Display Distance.rbt – Make a program where your display screen will show the distance from your ultrasonic sensor to the objects in front of it. Use a Sensor Block, Number to Text block and a Display Block.
  • 33. Light Sensor • The light sensor includes a light emitting diode (LED) light source that can be tuned on and off from software. This allows to measure either the reflected LED light shining back from an object or the ambient light falling on the sensor.
  • 34. ThresholdThreshold: • A “cutoff” or dividing line between two regions. One common use for thresholds is to divide the hundreds of possible sensor readings from a sensor (a Light Sensor can give a value anywhere from 0-100, for example) into two manageable categories. Threshold = Value A + Value B 2
  • 35. Programming Activity • Stop at line.rbt – using 2 move blocks, and a wait block– make a program that will cause your robot to stop when it drives over the black line.
  • 36. Programming Activity • Follow Line.rbt – Using a loop, switch and 4 move blocks create a program that will cause your robot to follow the black line.
  • 37. Programming Activity • Basic sumo.rbt – create a program that will cause your robot to drive around inside the black sumo wrestling ring, with out falling out. – Loop, move, wait blocks.
  • 39. Programming Activity • Multitask.rbt – Using your basic sumo program, make it so if it senses an opponent closer that 30cm it will charge forward really fast.