Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Mine Mapping Remote Communication.

Similar presentations


Presentation on theme: "© 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Mine Mapping Remote Communication."— Presentation transcript:

1 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Mine Mapping Remote Communication See Teacher Guide for printing instructions

2 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Opening Activity Identify five different ways you can get a message to someone in the next room. What are some advantages and disadvantages of the different methods?

3 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Opening Activity Walk over and talk Walk over and deliver a note by hand Write a note and throw it through a window Call using a telephone Yell through the wall Tap out a signal on the wall using morse code Yell to someone in the hall, and have that person yell it to the person in the other room Some possible methods:

4 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Opening Activity Speed? Privacy? Reliability? Complexity? Advantages and Disadvantages…

5 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Electronic Communication Computers need to get messages back and forth to each other Traditionally, computers are connected electronically through special wires that are used to carry the messages as electronic signals Computers connected in this way form a network When you plug your NXT in to your desktop or laptop computer using USB, you are essentially forming a tiny network! NXT Wired to PC This NXT communicates with the PC through its USB connection. The PC is also connected to other PCs in the room using an Ethernet network connection.

6 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Wireless Networks Recent developments in computer-to-computer communication involve networks without wires These technologies allow electronic devices to communicate using radio signals through air instead of electricity in a wire There are many different wireless technologies with various capabilities in terms of speed, range, privacy, robustness, and many other characteristics Mobile Phone This mobile phone actually communicates using two different wireless methods: one (GSM) for telephone calls, and a second (Bluetooth) to interface with the headset Placeholder for: Cell phone with Bluetooth headset

7 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Bluetooth One of these wireless technologies is called Bluetooth™ The NXT uses Bluetooth In the NXT system, Bluetooth can be used for communicating: –Between two NXTs –Between a desktop computer and an NXT We will be focusing on the NXT-to-NXT communication aspect for this activity NXT Bluetooth These two NXTs are connected using Bluetooth

8 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 NXT Bluetooth NXTs connected by Bluetooth can send messages back and forth to each other 1.Establish connection between NXTs 2.Send message from one NXT 3.Receive message on other NXT See Advanced > Bluetooth section… –Bluetooth Overview –Sending and Receiving Messages

9 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 NXT Bluetooth For this activity, you will write a program that sends sensor data from your NXT to your partner’s NXT –Your group will write both programs –You will load your Sender program on your own NXT –Your will load your Receiver program on your partner group’s NXT (SHARE!) –You and your partner must agree on whose NXT will initiate the Bluetooth connection, and always start the connection from that NXT in the future

10 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 NXT Bluetooth The Bluetooth connection must be established manually before programs can use the Send or Receive Message blocks –When communicating by Bluetooth, one NXT always “contacts” the other first to establish a Connection –Data “messages” can then be sent back and forth Send Message Block This block sends a message from one NXT… Receive Message Block …then this block receives it on a second NXT.

11 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Remote Communication: Technical Review Data Hubs & Wires Display Block Bluetooth Send & Receive Loops

12 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Data Hubs & Wires Many blocks have data hubs which can be opened by clicking the notch in the lower-left corner of the block. A data hub contains many data plugs, which allow information to flow in and out of the block. Data wires control the flow of data between blocks. Output plugs typically send out a sensor value, or the result of a computation. Such information usually goes into another block’s input plug, allowing the reading or result to be used as a value inside the block. Speed Controlled by Sensor Ultrasonic Sensor distance output plug controls the value of the Move Block’s power setting

13 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Display Block: Number The Display Block displays images or text on the NXT’s LCD display. The Display Block does not have built-in support for displaying Numbers. In order to display a Number, you must first convert it to Text using the Number to Text Block. The Display Block must also be configured to display Text, or it will ignore the wired-in value. Display (Local) Ultrasonic Sensor Value Ultrasonic Sensor on Port 4’s reading is converted to Text then displayed on the NXT’s LCD screen

14 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Bluetooth: Send Message The Send Message and Receive Message blocks work together to allow information to get from one NXT to another. Using Bluetooth in a program requires two NXTs connected in advance. The Send Message block is used to send data from the NXT where it is run, over a specified Connection Number, and places it in a mailbox (also specified in the Send block) on the destination NXT. Send Ultrasonic Sensor Value The Ultrasonic sensor value is read (once) and sent into Mailbox 1 on the NXT on the other end of Connection Number 1. We assume the Connection has been set up before running. More information about Bluetooth Messages can be found in Advanced > Bluetooth > Sending and Receiving Messages

15 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Bluetooth: Receive Message The Send Message and Receive Message blocks work together to allow information to get from one NXT to another. Using Bluetooth in a program requires two NXTs connected in advance. The Receive Message block retrieves a message from a specified mailbox. This also removes the message from the mailbox. Receive and Display Wait 3 seconds to give time for a message to arrive, then display the value of the Number message in Mailbox 1 on the NXT’s view screen for 5 seconds More information about Bluetooth Messages can be found in Advanced > Bluetooth > Sending and Receiving Messages

16 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Infinite Loop The Loop Block runs the blocks inside it over and over again, until a certain stopping condition is met. The infinite loop or “forever” loop has no stopping condition, and therefore will repeat the blocks inside over and over, forever. Back and Forth The loop causes the robot to repeat the forward-then-back motion forever

17 © 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Electronic devices communicate through both wired and wireless means NXTs use Bluetooth wireless communication to send and receive messages to and from other NXTs Summary You must connect two NXTs using the Bluetooth menus before you can use Send and Receive blocks in your programs One NXT will run a program with a Send Message block, then the other will use a Receive Message block to retrieve the data See the Advanced > Bluetooth section for more information


Download ppt "© 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Mine Mapping Remote Communication."

Similar presentations


Ads by Google