Sending, Receiving and Processing Messages NQC Tutorial pp.34-36.

Slides:



Advertisements
Similar presentations
RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.
Advertisements

NXTG Workshop Day 2 Programming with Touch Sensor Light Sensor Ultrasonic Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological.
Introduction to Macromedia Director 8.5 – Lingo
EducateNXT Follow the Leader Using Bluetooth communication, one robot can be made to follow the actions of a second robot. Features in this presentation:
.  The sender and recipient(s) of an message do not have to be online at the same time. When one person sends a message, it is stored on an.
Bridges Advanced Computer Networks.
Call signaling flow, H.245 Slow Start, Fast Connect and tunneling
Wait, sound sensor >70, Port 2 Flowchart – Heartbeat 1 Start Motor A, Move Backward, 1/3 Rotation, Power 20 Wait, 1 Second Sound Sensor (Port 2) Less than.
Packet Switching Network One of the common communications method is packet switching, which divides messages into packets and sends each packet individually.packet.
Xin November 22, Exercise start Skater turns towards skater2 Skater2 turns towards skater Skater moves to pose 2 Skater2 moves to pose 2 Bunny move.
(4.4) Internet Protocols Layered approach to Internet Software 1.
Termination Detection. Goal Study the development of a protocol for termination detection with the help of invariants.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
From the NXT top menu Connect desired hardware as indicated Enter a command in the box indicated from the menu provided Repeat for all 5 boxes.
Right Face Introductory Presentation. Opening Activity How can you use this to make a right turn program? This is your program from Full Speed Ahead to.
S A B D C T = 0 S gets message from above and sends messages to A, C and D S.
An Intro to Robots and Computer Programming
Using Variables Variables form a very important aspect of every programming language. Variables are memory locations in which we can store a value. We.
Tasks An NQC program consists of at most 10 tasks. Each task has a name. One task must have the name main, and this task will be executed. The other tasks.
Repeating Blocks of Code (updated 9/20/05 7:35pm) Reference NQC Tutorial pp 9-12.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
RobotC For Beginners Tyler Lutz and Keaton Bonds DRSS Enterprise.
Tell the robot exactly how to draw a square on the board.
INTERNET DATA FLOW Created by David Whitchurch for ISDS 4120 Louisiana State University.
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
Code Club Session 2 Dance Party. What will we learn ?  How to change the background  How to create animations  How to make objects talk to each other.
Getting Started! Lego Mindstorms Program NXT 2.0.
Autonomous Robot Project Lauren Mitchell Ashley Francis.
10/10/ Controlling YOUR ROBOT. 10/10/2015 Basic Stamp  Basic Stamp Input - output pins Interpreter Chip Power supply: 5 Volts voltage Memory: EEPROM.
Using Waits, Loops and Switches WAIT please!. Waits, Loops and Switches Pre-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can.
Use bluetooth for communication 1. enable bluetooth in NXT and also enable visibility 2. configure setting in brickCC –Wait about 30 seconds for searching.
Scratch Programming Lesson 2 First glance to programming logic.
 There are times when you will want blocks to repeat. Instead of duplicating blocks and ending up with a long script that might be confusing, there.
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Client-Server Model of Interaction Chapter 20. We have looked at the details of TCP/IP Protocols Protocols Router architecture Router architecture Now.
NXT Development Tutorial Part 3: Robot Arm NTHU CS Freshman Camp Shu-Ting Wang.
For Code Next For Code Next A loop is a segment of a code that repeats (changing slightly each time)
PROMGRAMING YOUR ROBOT How Servos Work: How to control your robot.
Multicasting  A message can be unicast, multicast, or broadcast. Let us clarify these terms as they relate to the Internet.
REVIEW OF “ON THE DUALITY OF OPERATING SYSTEM STRUCTURES” Paper by Hugh C. Lauer and Roger M. Needham Presentation by Erin Chapman.
Lesson 1: Motors and Sound Programming Solutions.
Recording communication of Skype Made by: Martin Fúsek.
ROBOLAB programming RCX to RCX communication Betsy Natter UNST 161 Winter 2004.
Forward Until Near Stop when near a wall.
EV3 Binary Bluetooth Functions An Introduction to Brick-to-Brick Communication.
BEGINNER PROGRAMMING LESSON
Presentation Outline I. Background Information II. Design Project
Modbus RTU CP1L with V1000 and Celciux.
NXT-G Binary Bluetooth Functions
6 Transport Layer Computer Networks Tutun Juhana
BOOTP and DHCP Objectives
HCP – Holub’s Communication Protocol
What is a Robot? A Electro-Mechanical system Plus Artificial intelligence Can do certain tasks that human like Robot Arm Honda Asimo Robot Fish Robot Vacuum.
Loops and Switches Pre-Quiz
Learning Outcomes Understand While Loop
Lab: (Finish parking). Bluetooth applications
Programming.
BEGINNER PROGRAMMING LESSON
CPS120: Introduction to Computer Science
Systems Design Nursebot
Controlling YOUR ROBOT
Forward Until Touch Robot goes forward until it hits a wall.
An Introduction to VEX IQ Programming with Modkit
SENSORS.
BEGINNER PROGRAMMING LESSON
Which way does the robot have to turn to get to the charger?
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
My first robot programming - Simple “GoTo”
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

Sending, Receiving and Processing Messages NQC Tutorial pp.34-36

Sending and Receiving Messages A robot can use the command SendMessage() to send a value (0-255) over the infra-red port. All other robots receive this message and store it. The program in a robot can ask for the value of the last message received using Message(). Based on this value the program can make the robot perform certain actions.

Master and Slave Two cooperating robots can interact: Master-- sends a message Slave-- responds to the message In the following example we will develop a communication protocol in which we define three messages: 1: go forward, 2: go backward, and 3: stop.

task main() // SLAVE { while (true) { ClearMessage(); until (Message() != 0); if (Message() == 1) {OnFwd(OUT_A+OUT_C);} if (Message() == 2) {OnRev(OUT_A+OUT_C);} if (Message() == 3) {Off(OUT_A+OUT_C);} } task main() // MASTER { SendMessage(1); Wait(200); SendMessage(2); Wait(200); SendMessage(3); }

Messaging Protocol for Nursebot start The message will represent the destination for nursebot. 6

When your nursebot is started, it should remain stationary at the starting point until it receives a message detailing the destination. At that time it should acknowledge receipt of the message by tone sounding. That is, if the destination is 4, sound a tone 4 times. (Hints: use a repeat loop and don’t forget to add a delay.)