Introduction to Programming RCX code 2.0 - PowerPoint PPT Presentation

About This Presentation
Title:

Introduction to Programming RCX code 2.0

Description:

Touch sensor is attached to the bumper. When the bumper is pressed the touch sensor is activated ... Repeat the process until the bumper is hit. Stop. Robofest 2005 ... – PowerPoint PPT presentation

Number of Views:72
Avg rating:3.0/5.0
Slides: 25
Provided by: robo4
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Programming RCX code 2.0


1
Introduction to Programming RCX code 2.0
2
Starting the RCX Programming Environment
  • Double Click on the RCX icon
  • Once the program is loaded, create a new user, or
    select an existing one
  • Click on Program
  • Click on Freestyle

3
Starting the RCX Programming Environment
4
Mission 1 Drive Forward (with Timer)
  • Go Forward for 5 seconds
  • Stop

5
(No Transcript)
6
Saving your work
  • Go to File
  • Click on Save
  • Type in File Name. i.e. First Mission

7
Downloading and Running
  • 5 different programs can be loaded onto the RCX
    at once
  • Select which slot you want to use by clicking on
    Settings and selecting one of the 5 slots
  • Make sure that the robots IR port is facing
    towards the IR tower, and click Download
  • When the download is finished, you will hear a
    beep
  • You can now run the program by pressing the grey
    Prgm button on the RCX to select the slot you
    programmed
  • And press the green Run button

8
Driving in Reverse
  • Use the Set Direction block under Small
    Blocks

9
(No Transcript)
10
  • After changing the directions, turn on the motors
    for 3 seconds

11
Turning
  • Set the direction of one motor to Forward and
    the direction of the other motor to Back

12
Light Sensor
  • Mounted to the front of the robot, facing the
    ground
  • Allows detection of lines, white or black, as
    well as detecting lamps, lasers, and other
    light sources
  • Use the View button on the robot to view the
    light sensor value over the black line. Remember
    or write down this value.

13
Using the light sensor
  • Select Wait Until from the Wait column
  • Select Light and click Next
  • Select Input Port to which the light sensor is
    connected. Press Next.
  • Select Bright if looking for white line, Dark
    if looking for black line. Press Next.

14
  • Click on Manual and enter a value for the line.
    Usually its the value from using the View
    button 5 for a white line, or the value from
    using the View button 5 for a black line

15
Mission 2 Drive Forward and Stop
  • Go forward until the edge of the board
  • Stop

16
Mission 3 Solution
17
Touch Sensor
  • Touch sensor is attached to the bumper
  • When the bumper is pressed the touch sensor is
    activated

18
Using the Touch Sensor
  • Turn on the motors
  • Select the Wait Until block from the Wait
    column or Repeat Until from the Repeat column
  • Make sure Touch is selected and press Next
  • Choose Input Port to which the touch sensor is
    connected, and press Next
  • Make sure Press is selected, which will allow
    the robot to react when the touch sensor is
    pressed. Press Next again.
  • Press Done
  • Turn off the motors

19
Mission 3 Right-Handed Line Follow with Touch
Sensor
  • If light sensor sees black - turn right,
    otherwise turn left
  • Repeat the process until the bumper is hit
  • Stop

20
Mission 3 Right-Handed Line Follow with Touch
Sensor
21
Mission 4 Line Follow and Stop
  • Follow the black line, until robot reaches edge
    of the board
  • Stop

22
Mission 4 Line Follow and Stop
23
Mission 5 Left-Handed Line FollowSolution will
be posted online at http//www.robofest.net
  • If light sensor sees black - turn left, otherwise
    turn right
  • Repeat the process until the bumper is hit
  • Stop

24
Mission 5 Left-Handed Line Follow
Write a Comment
User Comments (0)
About PowerShow.com