CS 102B Robot Design Thursday, 92304 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

CS 102B Robot Design Thursday, 92304

Description:

Double bumpers today! Roverbot file submissions due Friday, 9 ... 3.Turn right when the left bumper is pressed. 4. Turn left when the right bumper is pressed. ... – PowerPoint PPT presentation

Number of Views:24
Avg rating:3.0/5.0
Slides: 13
Provided by: Mathematic53
Category:

less

Transcript and Presenter's Notes

Title: CS 102B Robot Design Thursday, 92304


1
CS 102B Robot DesignThursday, 9/23/04
  • Todays Class
  • Saving and Submitting Lego Mindstorms Programs
  • Review of Roverbot Lab and Challenges
  • Reading
  • Ferrari pp. 98-100
  • Erwin Chap. 6, pp. 69-82 Discussion of
    programming touch sensors, line following in NQC
    code (version 1.5)
  • Assignments
  • Double bumpers today!
  • Roverbot file submissions due Friday, 9/24 by
    NOON
  • Graded only on submission of (nonempty) program,
    not on content!
  • Project 3 SumoBots!

2
Saving and submitting Lego Mindstorm programs
  • 1. Write your program in Lego Mindstorms.
  • Decide on a name no extension. E.g, MyProg, not
    MyProg.ext
  • 2. Save it to a drive (not a subfolder)
  • A for a floppy drive
  • C for the computer hard drive
  • WARNING C-drive erased when machine is rebooted!
  • 3. Copy it to other folders
  • The CS102b Submit Folder (in \\Datastor\mcs1)
  • Your own folder in \\Datastor\Students
  • You can also email it to me (as an attachment) to
    submit.

3
Roverbot Challenge 1
4
  • ROVERBOT CHALLENGE 2
  • 1. Zig-zag forwards
  • 2. When obstacle hit, beep and go backward for 1
    second.
  • 3.Turn right when the left bumper is pressed.
  • 4. Turn left when the right bumper is pressed.
  • 5. Zig-zag forward again.

5
ROVERBOT CHALLENGE 3
6
Basics of Programming Languages
  • Any programming language has
  • Task commands
  • Input/Output, calculation
  • Decision Structures (If-then, yes-no)
  • Statements that let you choose between two or
    more groups of statements
  • Repetition Structures (Repeat, For, While)
  • Statements that let you repeat a group of
    statements
  • Most modern programming languages have
  • Subprograms (Subroutines, functions)
  • Let you give a name to a whole set of statements
    to create a new single, complex statement
  • Some modern programming languages have
  • Parallel processing (Concurrency)
  • Perform two or more sets of tasks at the same time

7
Lego RCX Code Programming
  • Program block
  • Top block to begin every RCX Program
  • Small blocks (green)
  • Task commands, such as input, output,
    calculations
  • Wait Blocks (Red) and Repeat Blocks (Orange)
  • Repetition commands
  • Yes or No blocks (yellow)
  • Decision commands
  • Big blocks and My blocks
  • Subprograms
  • Sensor Blocks (blue)
  • Task blocks (Input)
  • Can run sequentially or concurrently

8
A Small Block Solution to the line-following
challenge
9
Small Blocks
  • Power
  • Turn motors on or off
  • Set power level (1-8)
  • Set or reverse direction
  • Sound
  • Beep (6 choices)
  • Tone (choose frequency)
  • Comm(unication)
  • Send or Clear IR message
  • Display variable value
  • Display clock
  • Variable
  • Do arithmetic operations
  • Reset
  • Reset light or timer
  • Advanced

10
Sensor Blocks
  • Sensors that get outside information
  • Touch sensor
  • Light sensor
  • IR sensor
  • Others not part of standard kit Rotation,
    temperature, humidity, etc.
  • Sensors that get internal information
  • Timer sensor
  • Variable sensor
  • Sensor blocks attach to the main program block
    and operate concurrently to commands under the
    main program block

11
Repetition Blocks
  • Repeat blocks
  • Repeat a set number of times, forever, while some
    condition is true, until some condition is true
  • Condition is value of internal or external
    sensor.
  • Wait blocks
  • These make the RCX do nothing until some
    condition is true

12
Decision block
  • Yes or No Block
  • Chooses between two options depending on whether
    a condition is true or false
  • How could we choose between 3 options? 4 options?
Write a Comment
User Comments (0)
About PowerShow.com