Robotics
description
Transcript of Robotics
Robotics
Module 1
Grading policy • Participation 10 marks
– Preparation, Promptness, Level of Engagement, Behavior• HWs 10 marks
– 2 HWs• Quizzes 10 marks
– 2 quizzes & SWQ• Practical 30 marks
– Lab activities and Practical exam • IAT competency exams (practical and knowledge ) 40
marks
Just a minute! Yesterday you
said x equals two
Robotics Applications
• Exploring other planets• Investigating deep-sea volcanoes• Assembling automobiles• Performing surgery
Medicine Dispenser RobotHome Security Robot
Data Hubs
Math Operation
Output (Result)
Input
Numbers
Data Type
• To create valid data wire connections between two programming blocks, you must draw a data wire from one block’s output plug to the other block’s input plug.
• The two plugs must support the same data type.
• Data types include numbers, text and logic data.
Data Wires
• Data wires are color-coded as follows:– Green data wires pass logic data ex. (0 and 1)– Yellow wires pass numeric data ex.
(1,2,3,..1.2,3.14)– Orange wires pass text ex. (a,b,c,chair,…..)– grey wires/broken wires: faulty connections
Broken data wire
• Data wires breaks for– Missing input - Occurs when a data wire is attached
to an originating programming block that has no input source.
– Too many inputs – Occurs when an input plug is configured to receive data from more than one input plug.
– Data type mismatch – Occurs when you attempt to connect a data wire between two incompatible data plug types.
Advanced Programming Blocks
Number to Text Block converts a numeric value to its equivalent text data.
Text Block join together up to three pieces of text
Keep Alive Block prevent the NXT from turning itself off.
The File Access Block create your own files on the NXT, which you can use to store any data that your programs use. The information you store in a file is persistent
The Calibrate Block calibrate light and sound sensors by adjusting the minimum and maximum values of the sensor.
Reset Motors Block resets the adjustment value of the motor to zero.
Bluetooth Connection Block
establish a connection with another Bluetooth device, such as NXT brick.
LAB ACTIVITY 1
LAB ACTIVITY 1
LAB ACTIVITY 1
•Suggest an application of the NXT-G code ?
•How can you modify the previous program to implement a sound meter?
Intensity
File Access Block
ActionFile Type
The File Access block allows you to create your own files on the NXT. Such files can be used to store any data that your programs use. For Example, you can store the values of the sensors to analyze and process them.
Action
• Write: Stores information in a file. If the file doesn’t exist, the access block will create one; otherwise, the new data is added on at the end of the existing file.
• Read: Retrieves information from a file.• Delete:• Close: Closes the file. You need to close the file
before you can read from, write to or delete it.
File Name
• use meaningful filenames that reflect the actual content of your files.
• The name in the NXT
Type
• File type setting tells the block which data type you are using.
• The file access block can read and write both numbers and text values.
LAB ACTIVITY 2
Action: writeName: RoboticsType: TextText: explorer
Action: closeName: Robotics Action: read
Name: RoboticsType: Text
Create a file in the NXT called Robotics,
What is written inside this file ?
Why did you close the robotics file,
then open it again?
How can I overwrite the robotics file ?
Action: Delete Name: Robotics
Action: writeName: RoboticsType: TextText: pinball
Action: closeName: Robotics
Action: readName: RoboticsType: Text
Why did you delete the file in the first place ?
Find the mistake
Action: writeName: exampleType: TextText: xyz
Action: readName: exampleType: Text
Action: writeName: exampleType: TextText: xyz
Action: closeName: example
Action: readName: exampleType: Text
Action: Text
Example Text: x Text: y Text: z Text: w
Activity 3
Action: writeName: lightlogType: number
Control: timeUntil: 20
Action: closeName: lightlog
Where is this lightlog located ?